diff --git a/libatomic/config/arm/host-config.h b/libatomic/config/arm/host-config.h index bbf4a3f84c3f3ae21fb2162aab68bdedf3fbdcb4..ef16fad2a35ec9055e918849e69a1a0e23b62838 100644 --- a/libatomic/config/arm/host-config.h +++ b/libatomic/config/arm/host-config.h @@ -1,4 +1,23 @@ /* Avoiding the DMB (or kernel helper) can be a good thing. */ #define WANT_SPECIALCASE_RELAXED +/* Glibc, at least, uses acq_rel in its pthread mutex + implementation. If the user is asking for seq_cst, + this is insufficient. */ + +static inline void __attribute__((always_inline, artificial)) +pre_seq_barrier(int model) +{ + if (model == __ATOMIC_SEQ_CST) + __atomic_thread_fence (__ATOMIC_SEQ_CST); +} + +static inline void __attribute__((always_inline, artificial)) +post_seq_barrier(int model) +{ + pre_seq_barrier(model); +} + +#define pre_post_seq_barrier 1 + #include_next