From: khizmax Date: Fri, 1 Jan 2016 13:41:16 +0000 (+0300) Subject: Fixed memory ordering X-Git-Tag: v2.1.0~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=98eae6c762cb2c141c43b48bed41e7cc92be316e;p=libcds.git Fixed memory ordering --- diff --git a/cds/urcu/details/gp.h b/cds/urcu/details/gp.h index 3f6dc83f..7cde5db0 100644 --- a/cds/urcu/details/gp.h +++ b/cds/urcu/details/gp.h @@ -40,7 +40,7 @@ namespace cds { namespace urcu { namespace details { uint32_t tmp = pRec->m_nAccessControl.load( atomics::memory_order_relaxed ); if ( (tmp & rcu_class::c_nNestMask) == 0 ) { pRec->m_nAccessControl.store( gp_singleton::instance()->global_control_word(atomics::memory_order_relaxed), - atomics::memory_order_relaxed ); + atomics::memory_order_release ); atomics::atomic_thread_fence( atomics::memory_order_acquire ); CDS_COMPILER_RW_BARRIER; } @@ -73,7 +73,7 @@ namespace cds { namespace urcu { namespace details { template inline bool gp_singleton::check_grace_period( typename gp_singleton::thread_record * pRec ) const { - uint32_t const v = pRec->m_nAccessControl.load( atomics::memory_order_relaxed ); + uint32_t const v = pRec->m_nAccessControl.load( atomics::memory_order_acquire ); return (v & general_purpose_rcu::c_nNestMask) && ((( v ^ m_nGlobalControl.load( atomics::memory_order_relaxed )) & ~general_purpose_rcu::c_nNestMask )); }