Fix Windows atomic get/set

According to:
http://msdn.microsoft.com/en-us/library/65tt87y8.aspx

MemoryBarrier() is the right macro to protect these, not _ReadBarrier()
and/or _WriteBarrier().
pull/1/head
Behdad Esfahbod 13 years ago
parent 8f8956a55f
commit 303d5850ec
  1. 4
      src/hb-atomic-private.hh

@ -47,8 +47,8 @@
#include <intrin.h>
typedef long hb_atomic_int_t;
#define hb_atomic_int_add(AI, V) _InterlockedExchangeAdd (&(AI), (V))
#define hb_atomic_int_set(AI, V) _InterlockedExchange (&(AI), (V))
#define hb_atomic_int_get(AI) (_ReadBarrier (), (AI))
#define hb_atomic_int_set(AI, V) ((AI) = (V), MemoryBarrier ())
#define hb_atomic_int_get(AI) (MemoryBarrier (), (AI))
#elif !defined(HB_NO_MT) && defined(__APPLE__)

Loading…
Cancel
Save