#ifndef BASE_ATOMICOPS_INTERNALS_PORTABLE_H_
#define BASE_ATOMICOPS_INTERNALS_PORTABLE_H_
#include <atomic>
#include "base/numerics/wrapping_math.h"
#include "build/build_config.h"
namespace base {
namespace subtle {
AtomicLocation32;
static_assert …;
inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) { … }
inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
Atomic32 new_value) { … }
inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) { … }
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) { … }
inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) { … }
inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value,
Atomic32 new_value) { … }
inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { … }
inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { … }
inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { … }
inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { … }
#if defined(ARCH_CPU_64_BITS)
AtomicU64;
AtomicLocation64;
static_assert …;
inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) { … }
inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
Atomic64 new_value) { … }
inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) { … }
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) { … }
inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) { … }
inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value,
Atomic64 new_value) { … }
inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { … }
inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { … }
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { … }
#endif
}
}
#endif