2006-05-05 Hans Boehm <Hans.Boehm@hp.com>
authorhboehm <hboehm>
Sat, 6 May 2006 00:20:44 +0000 (00:20 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:37 +0000 (21:06 +0400)
* include/private/gc_locks.h: Fix AO_test_and_set uses.

include/private/gc_locks.h

index 2be0cbe..5d7970a 100644 (file)
       /* and sleeping for fixed periods are likely to result in        */
       /* significant wasted time.  We thus rely mostly on queued locks. */
 #     define USE_SPIN_LOCK
-      extern volatile unsigned int GC_allocate_lock;
+      extern volatile AO_TS_t GC_allocate_lock;
       extern void GC_lock(void);
        /* Allocation lock holder.  Only set if acquired by client through */
        /* GC_call_with_alloc_lock.                                        */
 #     ifdef GC_ASSERTIONS
 #        define UNCOND_LOCK() \
-               { if (AO_test_and_set_acquire(&GC_allocate_lock)) GC_lock(); \
+               { if (AO_test_and_set_acquire(&GC_allocate_lock) == AO_TS_SET) \
+                       GC_lock(); \
                  SET_LOCK_HOLDER(); }
 #        define UNCOND_UNLOCK() \
                { GC_ASSERT(I_HOLD_LOCK()); UNSET_LOCK_HOLDER(); \
                  AO_CLEAR(&GC_allocate_lock); }
 #     else
 #        define UNCOND_LOCK() \
-               { if (AO_test_and_set_acquire(&GC_allocate_lock)) GC_lock(); }
+               { if (AO_test_and_set_acquire(&GC_allocate_lock) == AO_TS_SET) \
+                       GC_lock(); }
 #        define UNCOND_UNLOCK() \
                AO_CLEAR(&GC_allocate_lock)
 #     endif /* !GC_ASSERTIONS */