Created
April 21, 2017 05:42
-
-
Save toddlipcon/acebdf21ada799ee2b578b0714fa62a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cds/urcu/details/gp.h b/cds/urcu/details/gp.h | |
index 2bd7e36..1e050db 100644 | |
--- a/cds/urcu/details/gp.h | |
+++ b/cds/urcu/details/gp.h | |
@@ -73,7 +73,7 @@ namespace cds { namespace urcu { namespace details { | |
CDS_COMPILER_RW_BARRIER; | |
} | |
else { | |
- pRec->m_nAccessControl.fetch_add( 1, atomics::memory_order_relaxed ); | |
+ pRec->m_nAccessControl.store( tmp + 1, atomics::memory_order_relaxed ); | |
} | |
} | |
@@ -83,8 +83,8 @@ namespace cds { namespace urcu { namespace details { | |
thread_record * pRec = get_thread_record(); | |
assert( pRec != nullptr ); | |
- CDS_COMPILER_RW_BARRIER; | |
- pRec->m_nAccessControl.fetch_sub( 1, atomics::memory_order_release ); | |
+ uint32_t tmp = pRec->m_nAccessControl.load( atomics::memory_order_relaxed ); | |
+ pRec->m_nAccessControl.store( tmp - 1, atomics::memory_order_release ); | |
} | |
template <typename RCUtag> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment