Skip to content

Commit

Permalink
Merge pull request #30 from edmonds/branches/fix_generic_atomicops_me…
Browse files Browse the repository at this point in the history
…mory_models

generic atomicops: promote Acquire_Store() and Release_Load() to use SEQ_CST fence
  • Loading branch information
xfxyjwf committed Sep 19, 2014
2 parents dce98a8 + cc0a047 commit 7d50120
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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__
Expand Down

0 comments on commit 7d50120

Please sign in to comment.