]> granicus.if.org Git - gc/commitdiff
Guard against USE_PTHREAD_LOCKS and USE_SPIN_LOCK are both defined
authorIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 17:47:59 +0000 (20:47 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 17:47:59 +0000 (20:47 +0300)
USE_SPIN_LOCK might be specified by client. As it and USE_PTHREAD_LOCKS
are mutually exclusive, one of them should be undefined.

* include/private/gc_locks.h [(!AO_HAVE_test_and_set_acquire
|| GC_RTEMS_PTHREADS || SN_TARGET_PS3 || GC_WIN32_THREADS || LINT2)
&& GC_PTHREADS] (USE_SPIN_LOCK): Undefine (as USE_PTHREAD_LOCKS is
defined).

include/private/gc_locks.h

index fd56fc8425d0bb33870ed87840ab38318cff66de..11cf6f25df809df3a3618feb827af1a0c738883f 100644 (file)
@@ -50,6 +50,7 @@
        || defined(SN_TARGET_PS3) || defined(GC_WIN32_THREADS) \
        || defined(LINT2)) && defined(GC_PTHREADS)
 #    define USE_PTHREAD_LOCKS
+#    undef USE_SPIN_LOCK
 #  endif
 
 #  if defined(GC_WIN32_THREADS) && !defined(USE_PTHREAD_LOCKS)