From: khizmax Date: Mon, 24 Apr 2017 19:57:58 +0000 (+0300) Subject: Fixed uRCU barriers on read-side entry/exit X-Git-Tag: v2.3.0~57 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=246a6c7ab9f72b4e2f51a8ff955624b0aaa1c9af;p=libcds.git Fixed uRCU barriers on read-side entry/exit --- diff --git a/cds/urcu/details/gp.h b/cds/urcu/details/gp.h index eb43fc5f..512a0b2b 100644 --- a/cds/urcu/details/gp.h +++ b/cds/urcu/details/gp.h @@ -70,13 +70,7 @@ namespace cds { namespace urcu { namespace details { pRec->m_nAccessControl.store( gp_singleton::instance()->global_control_word(atomics::memory_order_relaxed), atomics::memory_order_relaxed ); -# if CDS_COMPILER == CDS_COMPILER_CLANG && CDS_COMPILER_VERSION < 30800 - // Seems, CLang 3.6-3.7 cannot handle acquire barrier correctly - CDS_COMPILER_RW_BARRIER; -# else - // acquire barrier - pRec->m_nAccessControl.load( atomics::memory_order_acquire ); -# endif + atomics::atomic_thread_fence( atomics::memory_order_seq_cst ); } else { // nested lock diff --git a/cds/urcu/details/sh.h b/cds/urcu/details/sh.h index f02c37a4..03ae2be6 100644 --- a/cds/urcu/details/sh.h +++ b/cds/urcu/details/sh.h @@ -74,13 +74,7 @@ namespace cds { namespace urcu { namespace details { pRec->m_nAccessControl.store( sh_singleton::instance()->global_control_word(atomics::memory_order_relaxed), atomics::memory_order_relaxed ); -# if CDS_COMPILER == CDS_COMPILER_CLANG && CDS_COMPILER_VERSION < 30800 - // Seems, CLang 3.6-3.7 cannot handle acquire barrier correctly CDS_COMPILER_RW_BARRIER; -# else - // acquire barrier - pRec->m_nAccessControl.load( atomics::memory_order_acquire ); -# endif } else { // nested lock @@ -97,7 +91,8 @@ namespace cds { namespace urcu { namespace details { uint32_t tmp = pRec->m_nAccessControl.load( atomics::memory_order_relaxed ); assert( ( tmp & rcu_class::c_nNestMask ) > 0 ); - pRec->m_nAccessControl.store( tmp - 1, atomics::memory_order_release ); + CDS_COMPILER_RW_BARRIER; + pRec->m_nAccessControl.store( tmp - 1, atomics::memory_order_relaxed ); } template