summaryrefslogtreecommitdiff
path: root/include/private/gc_locks.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/private/gc_locks.h')
-rw-r--r--include/private/gc_locks.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/private/gc_locks.h b/include/private/gc_locks.h
index eed9f10..a1aa561 100644
--- a/include/private/gc_locks.h
+++ b/include/private/gc_locks.h
@@ -76,7 +76,7 @@
# define LOCK() RT0u__inCritical++
# define UNLOCK() RT0u__inCritical--
# endif
-# ifdef SOLARIS_THREADS
+# ifdef GC_SOLARIS_THREADS
# include <thread.h>
# include <signal.h>
extern mutex_t GC_allocate_ml;
@@ -161,7 +161,7 @@
}
# define GC_TEST_AND_SET_DEFINED
inline static void GC_clear(volatile unsigned int *addr) {
- __asm__ __volatile__("eieio" ::: "memory");
+ __asm__ __volatile__("eieio" : : : "memory");
*(addr) = 0;
}
# define GC_CLEAR_DEFINED
@@ -221,9 +221,13 @@
# ifdef MIPS
# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) \
|| !defined(_COMPILER_VERSION) || _COMPILER_VERSION < 700
-# define GC_test_and_set(addr, v) test_and_set(addr,v)
+# ifdef __GNUC__
+# define GC_test_and_set(addr) _test_and_set(addr,1)
+# else
+# define GC_test_and_set(addr) test_and_set(addr,1)
+# endif
# else
-# define GC_test_and_set(addr, v) __test_and_set(addr,v)
+# define GC_test_and_set(addr) __test_and_set(addr,1)
# define GC_clear(addr) __lock_release(addr);
# define GC_CLEAR_DEFINED
# endif
@@ -261,8 +265,8 @@
# define USE_PTHREAD_LOCKS
# endif
-# if defined(LINUX_THREADS) || defined(OSF1_THREADS) \
- || defined(HPUX_THREADS)
+# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+ && !defined(GC_IRIX_THREADS)
# define NO_THREAD (pthread_t)(-1)
# include <pthread.h>
# if defined(PARALLEL_MARK)
@@ -412,8 +416,8 @@
# ifdef GC_ASSERTIONS
extern pthread_t GC_mark_lock_holder;
# endif
-# endif /* LINUX_THREADS || OSF1_THREADS || HPUX_THREADS */
-# if defined(IRIX_THREADS)
+# endif /* GC_PTHREADS with linux_threads.c implementation */
+# if defined(GC_IRIX_THREADS)
# include <pthread.h>
/* This probably should never be included, but I can't test */
/* on Irix anymore. */
@@ -439,8 +443,8 @@
GC_collecting = 1; \
}
# define EXIT_GC() GC_collecting = 0;
-# endif /* IRIX_THREADS */
-# ifdef WIN32_THREADS
+# endif /* GC_IRIX_THREADS */
+# ifdef GC_WIN32_THREADS
# include <windows.h>
GC_API CRITICAL_SECTION GC_allocate_ml;
# define LOCK() EnterCriticalSection(&GC_allocate_ml);