From 7c967f2cea2a75da2d09e8b2f6950e54a503234f Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 13 Jun 2015 00:03:45 +0300 Subject: [PATCH] Fixed MichaelList memory ordering --- cds/intrusive/michael_list_rcu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cds/intrusive/michael_list_rcu.h b/cds/intrusive/michael_list_rcu.h index 59ee10ac..c8f80303 100644 --- a/cds/intrusive/michael_list_rcu.h +++ b/cds/intrusive/michael_list_rcu.h @@ -235,7 +235,7 @@ namespace cds { namespace intrusive { // Mark the node (logical deletion) marked_node_ptr next(pos.pNext, 0); - if ( pos.pCur->m_pNext.compare_exchange_strong( next, next | nMask, memory_model::memory_order_acq_rel, atomics::memory_order_relaxed )) { + if ( pos.pCur->m_pNext.compare_exchange_strong( next, next | nMask, memory_model::memory_order_release, atomics::memory_order_relaxed )) { // Try physical removal - fast path marked_node_ptr cur(pos.pCur); @@ -1056,8 +1056,8 @@ namespace cds { namespace intrusive { pNext = pCur->m_pNext.load(memory_model::memory_order_acquire); - if ( pPrev->load(memory_model::memory_order_relaxed) != pCur - || pNext != pCur->m_pNext.load(memory_model::memory_order_relaxed)) + if ( pPrev->load(memory_model::memory_order_acquire) != pCur + || pNext != pCur->m_pNext.load(memory_model::memory_order_acquire)) { bkoff(); goto try_again; -- 2.34.1