diff options
author | wm4 <wm4@nowhere> | 2020-03-05 21:14:58 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-03-05 22:00:50 +0100 |
commit | 670610bc1d9429e150872c6be3ff399da01a87a0 (patch) | |
tree | 12427f508534a94c06e145cc597c419af766a965 | |
parent | 50177aaa3b2040cc76d59b2e19687d9016641c39 (diff) | |
download | mpv-670610bc1d9429e150872c6be3ff399da01a87a0.tar.bz2 mpv-670610bc1d9429e150872c6be3ff399da01a87a0.tar.xz |
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 <stdatomic.h>.
-rw-r--r-- | osdep/atomic.h | 9 |
1 files 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 <pthread.h> @@ -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 |