Cleanup atomic ops on OS X
This commit is contained in:
parent
e4b6d503c5
commit
a3547330fa
|
@ -55,10 +55,9 @@ typedef long hb_atomic_int_t;
|
|||
|
||||
#include <libkern/OSAtomic.h>
|
||||
typedef int32_t hb_atomic_int_t;
|
||||
#define hb_atomic_int_add(AI, V) (OSAtomicAdd32Barrier((V), &(AI)), (AI) - (V))
|
||||
#define hb_atomic_int_set(AI, V) \
|
||||
do {} while (!OSAtomicCompareAndSwap32 (hb_atomic_int_get (AI), (V), (&(AI))))
|
||||
#define hb_atomic_int_get(AI) OSAtomicAdd32Barrier(0, &(AI))
|
||||
#define hb_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
|
||||
#define hb_atomic_int_set(AI, V) ((AI) = (V), OSMemoryBarrier ())
|
||||
#define hb_atomic_int_get(AI) (OSMemoryBarrier (), (AI))
|
||||
|
||||
|
||||
#elif !defined(HB_NO_MT) && defined(HAVE_GLIB)
|
||||
|
|
Loading…
Reference in New Issue