2009-09-10 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mono / metadata / sgen-gc.h
1 #ifndef __MONO_SGENGC_H__
2 #define __MONO_SGENGC_H__
3
4 /* pthread impl */
5 #include <pthread.h>
6
7 #define ARCH_THREAD_TYPE pthread_t
8 #define ARCH_GET_THREAD pthread_self
9 #define ARCH_THREAD_EQUALS(a,b) pthread_equal (a, b)
10
11 /*
12  * Recursion is not allowed for the thread lock.
13  */
14 #define LOCK_DECLARE(name) pthread_mutex_t name = PTHREAD_MUTEX_INITIALIZER
15 #define LOCK_INIT(name)
16 #define LOCK_GC pthread_mutex_lock (&gc_mutex)
17 #define UNLOCK_GC pthread_mutex_unlock (&gc_mutex)
18
19 /* non-pthread will need to provide their own version of start/stop */
20 #define USE_SIGNAL_BASED_START_STOP_WORLD 1
21 /* we intercept pthread_create calls to know which threads exist */
22 #define USE_PTHREAD_INTERCEPT 1
23
24 #endif /* __MONO_SGENGC_H__ */
25