33 #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MACOSX_H_
34 #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MACOSX_H_
36 #include <libkern/OSAtomic.h>
47 if (OSAtomicCompareAndSwap32(old_value, new_value,
48 const_cast<Atomic32*>(ptr))) {
52 }
while (prev_value == old_value);
61 }
while (!OSAtomicCompareAndSwap32(old_value, new_value,
62 const_cast<Atomic32*>(ptr)));
68 return OSAtomicAdd32(increment, const_cast<Atomic32*>(ptr));
73 return OSAtomicAdd32Barrier(increment, const_cast<Atomic32*>(ptr));
85 if (OSAtomicCompareAndSwap32Barrier(old_value, new_value,
86 const_cast<Atomic32*>(ptr))) {
90 }
while (prev_value == old_value);
135 Atomic64 new_value) {
138 if (OSAtomicCompareAndSwap64(old_value, new_value,
139 reinterpret_cast<volatile int64_t*>(ptr))) {
143 }
while (prev_value == old_value);
148 Atomic64 new_value) {
152 }
while (!OSAtomicCompareAndSwap64(old_value, new_value,
153 reinterpret_cast<volatile int64_t*>(ptr)));
158 Atomic64 increment) {
159 return OSAtomicAdd64(increment, reinterpret_cast<volatile int64_t*>(ptr));
163 Atomic64 increment) {
164 return OSAtomicAdd64Barrier(increment,
165 reinterpret_cast<volatile int64_t*>(ptr));
170 Atomic64 new_value) {
173 if (OSAtomicCompareAndSwap64Barrier(
174 old_value, new_value, reinterpret_cast<volatile int64_t*>(ptr))) {
178 }
while (prev_value == old_value);
184 Atomic64 new_value) {
208 inline Atomic64
Acquire_Load(
volatile const Atomic64* ptr) {
209 Atomic64
value = *ptr;
214 inline Atomic64
Release_Load(
volatile const Atomic64* ptr) {
219 #endif // defined(__LP64__)
225 #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_MACOSX_H_
Atomic32 Acquire_Load(volatile const Atomic32 *ptr)
Definition: atomicops_internals_arm64_gcc.h:167
void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:149
Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:52
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:154
Atomic32 Release_Load(volatile const Atomic32 *ptr)
Definition: atomicops_internals_arm64_gcc.h:180
Definition: document.h:390
int32 Atomic32
Definition: atomicops.h:65
Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:136
Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
Definition: atomicops_internals_arm64_gcc.h:118
Definition: BnetFileGenerator.h:47
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
Definition: atomicops_internals_arm64_gcc.h:97
const FieldDescriptor value
Definition: descriptor.h:1522
Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:77
void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:145
Atomic32 NoBarrier_Load(volatile const Atomic32 *ptr)
Definition: atomicops_internals_arm64_gcc.h:163
Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:127
void MemoryBarrier()
Definition: atomicops_internals_arm64_gcc.h:40