From: Behdad Esfahbod Date: Wed, 1 Aug 2018 02:33:37 +0000 (-0700) Subject: [atomic] Use CONSUME, not ACQUIRE, memory-order for get() X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3dd1b88765f6ce91bd0558a16cdd8cf0c1e15d1b;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [atomic] Use CONSUME, not ACQUIRE, memory-order for get() Although, all implementations just elevate that to ACQUIRE. But requirement for us is just CONSUME. --- diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index 02cf6f3..e6a3a9a 100644 --- a/src/hb-atomic-private.hh +++ b/src/hb-atomic-private.hh @@ -46,14 +46,14 @@ /* Defined externally, i.e. in config.h; must have typedef'ed hb_atomic_int_impl_t as well. */ -#elif !defined(HB_NO_MT) && defined(__ATOMIC_ACQUIRE) +#elif !defined(HB_NO_MT) && defined(__ATOMIC_CONSUME) /* C++11-style GCC primitives. */ typedef int hb_atomic_int_impl_t; #define hb_atomic_int_impl_add(AI, V) __atomic_fetch_add (&(AI), (V), __ATOMIC_ACQ_REL) -#define hb_atomic_ptr_impl_get(P) __atomic_load_n ((P), __ATOMIC_ACQUIRE) +#define hb_atomic_ptr_impl_get(P) __atomic_load_n ((P), __ATOMIC_CONSUME) static inline bool _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) { @@ -71,7 +71,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) typedef int hb_atomic_int_impl_t; #define hb_atomic_int_impl_add(AI, V) (reinterpret_cast *> (&AI)->fetch_add ((V), std::memory_order_acq_rel)) -#define hb_atomic_ptr_impl_get(P) (reinterpret_cast *> (P)->load (std::memory_order_acquire)) +#define hb_atomic_ptr_impl_get(P) (reinterpret_cast *> (P)->load (std::memory_order_consume)) static inline bool _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) {