# endif
# if (!defined(AO_HAVE_test_and_set_acquire) || defined(GC_RTEMS_PTHREADS) \
- || defined(GC_WIN32_THREADS)) && defined(GC_PTHREADS)
+ || defined(SN_TARGET_PS3) || defined(GC_WIN32_THREADS)) \
+ && defined(GC_PTHREADS)
# define USE_PTHREAD_LOCKS
# endif
|| GC_lock_holder == GetCurrentThreadId())
# define I_DONT_HOLD_LOCK() (!GC_need_to_lock \
|| GC_lock_holder != GetCurrentThreadId())
-# elif defined(SN_TARGET_PS3)
-# include <pthread.h>
- GC_EXTERN pthread_mutex_t GC_allocate_ml;
-# define LOCK() pthread_mutex_lock(&GC_allocate_ml)
-# define UNLOCK() pthread_mutex_unlock(&GC_allocate_ml)
# elif defined(GC_PTHREADS)
# include <pthread.h>
GC_lock(); }
# define UNCOND_UNLOCK() AO_CLEAR(&GC_allocate_lock)
# endif /* !GC_ASSERTIONS */
-# else /* THREAD_LOCAL_ALLOC || USE_PTHREAD_LOCKS */
+# else /* THREAD_LOCAL_ALLOC || USE_PTHREAD_LOCKS */
# ifndef USE_PTHREAD_LOCKS
# define USE_PTHREAD_LOCKS
# endif
-# endif /* THREAD_LOCAL_ALLOC || USE_PTHREAD_LOCK */
+# endif /* THREAD_LOCAL_ALLOC || USE_PTHREAD_LOCKS */
# ifdef USE_PTHREAD_LOCKS
# include <pthread.h>
GC_EXTERN pthread_mutex_t GC_allocate_ml;
pthread_mutex_unlock(&GC_allocate_ml); }
# else /* !GC_ASSERTIONS */
# if defined(NO_PTHREAD_TRYLOCK)
-# define UNCOND_LOCK() GC_lock()
-# else /* !defined(NO_PTHREAD_TRYLOCK) */
-# define UNCOND_LOCK() \
- { if (0 != pthread_mutex_trylock(&GC_allocate_ml)) \
- GC_lock(); }
+# ifdef USE_SPIN_LOCK
+# define UNCOND_LOCK() GC_lock()
+# else
+# define UNCOND_LOCK() pthread_mutex_lock(&GC_allocate_ml)
+# endif
+# else
+# define UNCOND_LOCK() \
+ { if (0 != pthread_mutex_trylock(&GC_allocate_ml)) \
+ GC_lock(); }
# endif
# define UNCOND_UNLOCK() pthread_mutex_unlock(&GC_allocate_ml)
# endif /* !GC_ASSERTIONS */