From 246a6c7ab9f72b4e2f51a8ff955624b0aaa1c9af Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 24 Apr 2017 22:57:58 +0300 Subject: [PATCH] Fixed uRCU barriers on read-side entry/exit --- cds/urcu/details/gp.h | 8 +------- cds/urcu/details/sh.h | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) 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 -- 2.34.1