28 template <
typename T,
typename IsTLarge =
void>
31 static T compareAndSwap(
volatile T* dest, T expected, T newValue) {
32 __atomic_compare_exchange(
33 dest, &expected, &newValue,
false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
37 static T swap(
volatile T* dest, T newValue) {
39 __atomic_exchange(dest, &newValue, &result, __ATOMIC_SEQ_CST);
43 static T load(
volatile const T* value) {
45 __atomic_load(value, &result, __ATOMIC_SEQ_CST);
49 static T loadRelaxed(
volatile const T* value) {
51 __atomic_load(value, &result, __ATOMIC_RELAXED);
55 static void store(
volatile T* dest, T newValue) {
56 __atomic_store(dest, &newValue, __ATOMIC_SEQ_CST);
59 static T fetchAndAdd(
volatile T* dest, T increment) {
60 return __atomic_fetch_add(dest, increment, __ATOMIC_SEQ_CST);
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
Instantiation of AtomicIntrinsics<> for all word types T.
Definition: atomic_intrinsics_gcc_atomic.h:29