From 670610bc1d9429e150872c6be3ff399da01a87a0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 5 Mar 2020 21:14:58 +0100 Subject: atomic: add atomic_exchange_explicit() fallback Apparently I want to use this in a later commit. Untested, because this is a pre-C11 fallback, and I only test with real . --- osdep/atomic.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/osdep/atomic.h b/osdep/atomic.h index 0c4de4b578..774924afa2 100644 --- a/osdep/atomic.h +++ b/osdep/atomic.h @@ -48,8 +48,7 @@ typedef struct { uint64_t v; } mp_atomic_uint64; #define memory_order_relaxed 1 #define memory_order_seq_cst 2 - -#define atomic_load_explicit(p, e) atomic_load(p) +#define memory_order_acq_rel 3 #include @@ -99,6 +98,12 @@ extern pthread_mutex_t mp_atomic_mutex; pthread_mutex_unlock(&mp_atomic_mutex); \ res_; }) +#define atomic_load_explicit(a, b) \ + atomic_load(a) + +#define atomic_exchange_explicit(a, b, c) \ + atomic_exchange(a, b) + #endif /* else HAVE_STDATOMIC */ #endif -- cgit v1.2.3