mach_port_deallocate (current_task (), info->native_handle);
}
-MonoNativeThreadId
-mono_native_thread_id_get (void)
-{
- return pthread_self ();
-}
-
-gboolean
-mono_native_thread_id_equals (MonoNativeThreadId id1, MonoNativeThreadId id2)
-{
- return pthread_equal (id1, id2);
-}
-
-/*
- * mono_native_thread_create:
- *
- * Low level thread creation function without any GC wrappers.
- */
-gboolean
-mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg)
-{
- return pthread_create (tid, NULL, func, arg) == 0;
-}
-
-void
-mono_threads_core_set_name (MonoNativeThreadId tid, const char *name)
-{
- /* pthread_setnmae_np() on Mac is not documented and doesn't receive thread id. */
-}
#endif /* USE_MACH_BACKEND */
#ifdef __MACH__
#else
return pthread_kill (mono_thread_info_get_tid (info), signum);
#endif
+}
+
+MonoNativeThreadId
+mono_native_thread_id_get (void)
+{
+ return pthread_self ();
+}
+gboolean
+mono_native_thread_id_equals (MonoNativeThreadId id1, MonoNativeThreadId id2)
+{
+ return pthread_equal (id1, id2);
}
-#if defined (USE_POSIX_BACKEND)
+/*
+ * mono_native_thread_create:
+ *
+ * Low level thread creation function without any GC wrappers.
+ */
+gboolean
+mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg)
+{
+ return pthread_create (tid, NULL, func, arg) == 0;
+}
+
+void
+mono_threads_core_set_name (MonoNativeThreadId tid, const char *name)
+{
+#if defined (HAVE_PTHREAD_SETNAME_NP) && !defined (__MACH__)
+ if (!name) {
+ pthread_setname_np (tid, "");
+ } else {
+ char n [16];
+
+ strncpy (n, name, 16);
+ n [15] = '\0';
+ pthread_setname_np (tid, n);
+ }
+#endif
+}
+
+
+#if defined (USE_POSIX_BACKEND) && !defined (USE_COOP_GC)
static int suspend_signal_num;
static int restart_signal_num;
{
}
-MonoNativeThreadId
-mono_native_thread_id_get (void)
-{
- return pthread_self ();
-}
-
-gboolean
-mono_native_thread_id_equals (MonoNativeThreadId id1, MonoNativeThreadId id2)
-{
- return pthread_equal (id1, id2);
-}
-
-/*
- * mono_native_thread_create:
- *
- * Low level thread creation function without any GC wrappers.
- */
-gboolean
-mono_native_thread_create (MonoNativeThreadId *tid, gpointer func, gpointer arg)
-{
- return pthread_create (tid, NULL, func, arg) == 0;
-}
-
-void
-mono_threads_core_set_name (MonoNativeThreadId tid, const char *name)
-{
-#if defined (HAVE_PTHREAD_SETNAME_NP) && !defined (__MACH__)
- if (!name) {
- pthread_setname_np (tid, "");
- } else {
- char n [16];
-
- strncpy (n, name, 16);
- n [15] = '\0';
- pthread_setname_np (tid, n);
- }
-#endif
-}
-
#endif /*defined (USE_POSIX_BACKEND)*/
#endif
/* If this is defined, use the signals backed on Mach. Debug only as signals can't be made usable on OSX. */
// #define USE_SIGNALS_ON_MACH
-#if defined (_POSIX_VERSION) || defined (__native_client__)
+
+#if defined (USE_COOP_GC)
+#define USE_COOP_BACKEND
+#define MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND 1
+
+#elif defined (_POSIX_VERSION) || defined (__native_client__)
+#define MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND 0
+
#if defined (__MACH__) && !defined (USE_SIGNALS_ON_MACH)
#define USE_MACH_BACKEND
#else
#define USE_POSIX_BACKEND
#endif
-#endif
+#elif HOST_WIN32
+#define MONO_THREADS_PLATFORM_REQUIRES_UNIFIED_SUSPEND 0
+#define USE_WINDOWS_BACKEND
+
+#endif
enum {
STATE_STARTING = 0x00,