2008-07-11 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / sgen-gc.h
index 8372b6546cf9db83ff882bb69339b204b5ea5378..6cd4e0fcfe8ab136d6fbed04d9fe41cf6ba17941 100644 (file)
@@ -1,6 +1,26 @@
 #ifndef __MONO_SGENGC_H__
 #define __MONO_SGENGC_H__
 
+/* pthread impl */
+#include <pthread.h>
+
+#define ARCH_THREAD_TYPE pthread_t
+#define ARCH_GET_THREAD pthread_self
+#define ARCH_THREAD_EQUALS(a,b) pthread_equal (a, b)
+
+/*
+ * Recursion is not allowed for the thread lock.
+ */
+#define LOCK_DECLARE(name) pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
+#define LOCK_INIT(name)
+#define LOCK_GC pthread_mutex_lock (&gc_mutex)
+#define UNLOCK_GC pthread_mutex_unlock (&gc_mutex)
+
+/* non-pthread will need to provide their own version of start/stop */
+#define USE_SIGNAL_BASED_START_STOP_WORLD 1
+/* we intercept pthread_create calls to know which threads exist */
+#define USE_PTHREAD_INTERCEPT 1
+
 #ifdef __i386__
 #define ARCH_NUM_REGS 8
 #define ARCH_STORE_REGS(ptr)   \