diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-08-04 11:21:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-04 11:21:40 -0700 |
commit | c59473d53eafadd126502657e5c5c33e952b67ed (patch) | |
tree | 86981ead107a395353e05fe99d1576060c319b05 | |
parent | 6d134eac6fd57021b01a40269ce817a7ebfbdb9b (diff) | |
parent | fd1c289886c341af4426873a7214067c245e4bbe (diff) |
Merge pull request #1044 from mark-whiting/master
Adding missing generic gcc 64-bit atomicops.
-rw-r--r-- | src/google/protobuf/stubs/atomicops_internals_generic_gcc.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h index a0116a60..7314ee4f 100644 --- a/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h +++ b/src/google/protobuf/stubs/atomicops_internals_generic_gcc.h @@ -128,6 +128,24 @@ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, return old_value; } +inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, + Atomic64 increment) { + return __atomic_add_fetch(ptr, increment, __ATOMIC_RELAXED); +} + +inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) { + __atomic_store_n(ptr, value, __ATOMIC_RELAXED); +} + +inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, + Atomic64 new_value) { + return __atomic_exchange_n(ptr, new_value, __ATOMIC_RELAXED); +} + +inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { + return __atomic_load_n(ptr, __ATOMIC_RELAXED); +} + #endif // defined(__LP64__) } // namespace internal |