[coop] On OSX, set native_handle to the mac port.
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 18 Aug 2015 22:52:10 +0000 (18:52 -0400)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 18 Aug 2015 23:08:21 +0000 (19:08 -0400)
mono/utils/mono-threads-coop.c

index f0dc7585aac9162157f3348045209d439cf28a82..8bcc7279d8df7606429b474acbe866f4787d06b0 100644 (file)
 #include <mono/utils/mono-time.h>
 #include <mono/utils/mono-counters.h>
 
+#ifdef TARGET_OSX
+#include <mono/utils/mach-support.h>
+#endif
+
 #ifdef USE_COOP_BACKEND
 
 volatile size_t mono_polling_required;
@@ -248,12 +252,20 @@ mono_threads_init_platform (void)
 void
 mono_threads_platform_free (MonoThreadInfo *info)
 {
+#ifdef TARGET_OSX
+       mach_port_deallocate (current_task (), info->native_handle);
+#endif
+
        //See the above for what's wrong here.
 }
 
 void
 mono_threads_platform_register (MonoThreadInfo *info)
 {
+#ifdef TARGET_OSX
+       info->native_handle = mach_thread_self ();
+#endif
+
        //See the above for what's wrong here.
 }