[HarfBuzz] harfbuzz-ng: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Sun May 27 07:23:23 PDT 2012


 src/hb-atomic-private.hh |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit a3547330fa88e30a138f6f17e60d9c7d1e316622
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun May 27 10:20:47 2012 -0400

    Cleanup atomic ops on OS X

diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh
index ba52773..458c984 100644
--- a/src/hb-atomic-private.hh
+++ b/src/hb-atomic-private.hh
@@ -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)



More information about the HarfBuzz mailing list