19 #ifndef COMPAT_ATOMICS_SUNCC_STDATOMIC_H
20 #define COMPAT_ATOMICS_SUNCC_STDATOMIC_H
27 #define ATOMIC_FLAG_INIT 0
29 #define ATOMIC_VAR_INIT(value) (value)
31 #define atomic_init(obj, value) \
36 #define kill_dependency(y) ((void)0)
38 #define atomic_thread_fence(order) \
39 __machine_rw_barrier();
41 #define atomic_signal_fence(order) \
44 #define atomic_is_lock_free(obj) 0
83 static inline void atomic_store(intptr_t *
object, intptr_t desired)
86 __machine_rw_barrier();
89 #define atomic_store_explicit(object, desired, order) \
90 atomic_store(object, desired)
94 __machine_rw_barrier();
98 #define atomic_load_explicit(object, order) \
101 #define atomic_exchange(object, desired) \
102 atomic_swap_ptr(object, desired)
104 #define atomic_exchange_explicit(object, desired, order) \
105 atomic_exchange(object, desired)
110 intptr_t old = *expected;
111 *expected = (intptr_t)atomic_cas_ptr(
object, (
void *)old, (
void *)desired);
112 return *expected == old;
115 #define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
116 atomic_compare_exchange_strong(object, expected, desired)
118 #define atomic_compare_exchange_weak(object, expected, desired) \
119 atomic_compare_exchange_strong(object, expected, desired)
121 #define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
122 atomic_compare_exchange_weak(object, expected, desired)
126 return atomic_add_ptr_nv(
object, operand) - operand;
129 #define atomic_fetch_sub(object, operand) \
130 atomic_fetch_add(object, -(operand))
159 #define atomic_fetch_add_explicit(object, operand, order) \
160 atomic_fetch_add(object, operand)
162 #define atomic_fetch_sub_explicit(object, operand, order) \
163 atomic_fetch_sub(object, operand)
165 #define atomic_fetch_or_explicit(object, operand, order) \
166 atomic_fetch_or(object, operand)
168 #define atomic_fetch_xor_explicit(object, operand, order) \
169 atomic_fetch_xor(object, operand)
171 #define atomic_fetch_and_explicit(object, operand, order) \
172 atomic_fetch_and(object, operand)
174 #define atomic_flag_test_and_set(object) \
175 atomic_exchange(object, 1)
177 #define atomic_flag_test_and_set_explicit(object, order) \
178 atomic_flag_test_and_set(object)
180 #define atomic_flag_clear(object) \
181 atomic_store(object, 0)
183 #define atomic_flag_clear_explicit(object, order) \
184 atomic_flag_clear(object)
static intptr_t atomic_load(intptr_t *object)
intptr_t atomic_uint_fast8_t
intptr_t atomic_int_least8_t
intptr_t atomic_int_least32_t
intptr_t atomic_int_fast16_t
static intptr_t atomic_fetch_or(intptr_t *object, intptr_t operand)
intptr_t atomic_uintptr_t
intptr_t atomic_int_fast32_t
static void atomic_store(intptr_t *object, intptr_t desired)
static intptr_t atomic_fetch_add(intptr_t *object, intptr_t operand)
intptr_t atomic_int_fast8_t
static intptr_t atomic_fetch_xor(intptr_t *object, intptr_t operand)
intptr_t atomic_uint_fast16_t
static intptr_t atomic_fetch_and(intptr_t *object, intptr_t operand)
intptr_t atomic_int_least16_t
intptr_t atomic_uint_fast32_t
intptr_t atomic_uint_least32_t
intptr_t atomic_int_fast64_t
intptr_t atomic_uint_least16_t
static int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected, intptr_t desired)
intptr_t atomic_uint_fast64_t
intptr_t atomic_uintmax_t
intptr_t atomic_int_least64_t
intptr_t atomic_ptrdiff_t
intptr_t atomic_uint_least8_t
intptr_t atomic_uint_least64_t