pRec->m_nAccessControl.store( gp_singleton<RCUtag>::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
pRec->m_nAccessControl.store( sh_singleton<RCUtag>::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
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 <typename RCUtag>