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().
This commit is contained in:
Behdad Esfahbod 2012-05-27 10:01:13 -04:00
parent 8f8956a55f
commit 303d5850ec
1 changed files with 2 additions and 2 deletions

View File

@ -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__)