diff options
author | xfxyjwf <xfxyjwf@gmail.com> | 2014-09-19 12:00:58 -0700 |
---|---|---|
committer | xfxyjwf <xfxyjwf@gmail.com> | 2014-09-19 12:00:58 -0700 |
commit | 7d50120316b62499d1ec64580acc8ff32fceb147 (patch) | |
tree | cd91ef9cbffb3a66254fd32af791020680a34dac /src | |
parent | dce98a8d4c662b94c4840a58f3c0263bf5c5e4c8 (diff) | |
parent | cc0a047384414991009d95ada9e89b9a92aac531 (diff) | |
download | protobuf-7d50120316b62499d1ec64580acc8ff32fceb147.tar.gz protobuf-7d50120316b62499d1ec64580acc8ff32fceb147.tar.bz2 protobuf-7d50120316b62499d1ec64580acc8ff32fceb147.zip |
Merge pull request #30 from edmonds/branches/fix_generic_atomicops_memory_models
generic atomicops: promote Acquire_Store() and Release_Load() to use SEQ_CST fence
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/stubs/atomicops_internals_generic_gcc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h index e30bb444..dd7abf6f 100644 --- a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h +++ b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h @@ -83,7 +83,7 @@ inline void MemoryBarrier() { } inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { - __atomic_store_n(ptr, value, __ATOMIC_ACQUIRE); + __atomic_store_n(ptr, value, __ATOMIC_SEQ_CST); } inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { @@ -99,7 +99,7 @@ inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { } inline Atomic32 Release_Load(volatile const Atomic32* ptr) { - return __atomic_load_n(ptr, __ATOMIC_RELEASE); + return __atomic_load_n(ptr, __ATOMIC_SEQ_CST); } #ifdef __LP64__ |