From: khizmax Date: Mon, 24 Apr 2017 16:05:21 +0000 (+0300) Subject: Restored acq-rel fence in urcu access_lock(). X-Git-Tag: v2.3.0~59 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b0bfe21abce7a1c51e356b81c8b9091e8fab4982;p=libcds.git Restored acq-rel fence in urcu access_lock(). Seems, CLang 3.6/3.7 cannot handle acquire barrier on atomic var correctly --- diff --git a/cds/urcu/details/gp.h b/cds/urcu/details/gp.h index 41287a7d..eb43fc5f 100644 --- a/cds/urcu/details/gp.h +++ b/cds/urcu/details/gp.h @@ -70,8 +70,13 @@ 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 } else { // nested lock diff --git a/cds/urcu/details/sh.h b/cds/urcu/details/sh.h index 8d0969f2..f02c37a4 100644 --- a/cds/urcu/details/sh.h +++ b/cds/urcu/details/sh.h @@ -74,8 +74,13 @@ 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