Go to the documentation of this file.
24 #ifndef COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
25 #define COMPAT_ATOMICS_PTHREAD_STDATOMIC_H
29 #define ATOMIC_FLAG_INIT 0
31 #define ATOMIC_VAR_INIT(value) (value)
33 #define atomic_init(obj, value) \
38 #define kill_dependency(y) ((void)0)
40 #define atomic_signal_fence(order) \
43 #define atomic_is_lock_free(obj) 0
91 static inline void atomic_store(intptr_t *
object, intptr_t desired)
98 #define atomic_store_explicit(object, desired, order) \
99 atomic_store(object, desired)
110 #define atomic_load_explicit(object, order) \
123 #define atomic_exchange_explicit(object, desired, order) \
124 atomic_exchange(object, desired)
131 if (*
object == *expected) {
142 #define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
143 atomic_compare_exchange_strong(object, expected, desired)
145 #define atomic_compare_exchange_weak(object, expected, desired) \
146 atomic_compare_exchange_strong(object, expected, desired)
148 #define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
149 atomic_compare_exchange_weak(object, expected, desired)
151 #define FETCH_MODIFY(opname, op) \
152 static inline intptr_t atomic_fetch_ ## opname(intptr_t *object, intptr_t operand) \
155 avpriv_atomic_lock(); \
157 *object = *object op operand; \
158 avpriv_atomic_unlock(); \
170 #define atomic_fetch_add_explicit(object, operand, order) \
171 atomic_fetch_add(object, operand)
173 #define atomic_fetch_sub_explicit(object, operand, order) \
174 atomic_fetch_sub(object, operand)
176 #define atomic_fetch_or_explicit(object, operand, order) \
177 atomic_fetch_or(object, operand)
179 #define atomic_fetch_xor_explicit(object, operand, order) \
180 atomic_fetch_xor(object, operand)
182 #define atomic_fetch_and_explicit(object, operand, order) \
183 atomic_fetch_and(object, operand)
185 #define atomic_flag_test_and_set(object) \
186 atomic_exchange(object, 1)
188 #define atomic_flag_test_and_set_explicit(object, order) \
189 atomic_flag_test_and_set(object)
191 #define atomic_flag_clear(object) \
192 atomic_store(object, 0)
194 #define atomic_flag_clear_explicit(object, order) \
195 atomic_flag_clear(object)
intptr_t atomic_ptrdiff_t
static float sub(float src0, float src1)
intptr_t atomic_uint_least8_t
void avpriv_atomic_lock(void)
intptr_t atomic_uint_fast8_t
intptr_t atomic_int_least8_t
intptr_t atomic_int_fast32_t
static void atomic_thread_fence(int order)
intptr_t atomic_int_fast16_t
intptr_t atomic_uintptr_t
static void atomic_store(intptr_t *object, intptr_t desired)
intptr_t atomic_int_least32_t
static intptr_t atomic_load(intptr_t *object)
intptr_t atomic_int_fast8_t
static int atomic_compare_exchange_strong(intptr_t *object, intptr_t *expected, intptr_t desired)
void avpriv_atomic_unlock(void)
intptr_t atomic_uint_fast16_t
intptr_t atomic_int_least16_t
intptr_t atomic_uint_least16_t
intptr_t atomic_uint_fast32_t
intptr_t atomic_uint_least32_t
intptr_t atomic_int_least64_t
intptr_t atomic_int_fast64_t
#define FETCH_MODIFY(opname, op)
intptr_t atomic_uint_fast64_t
static float add(float src0, float src1)
intptr_t atomic_uintmax_t
static intptr_t atomic_exchange(intptr_t *object, intptr_t desired)
intptr_t atomic_uint_least64_t