return CreateThread (NULL, 0, (func), (arg), 0, (tid)) != NULL;
}
+gboolean
+mono_native_thread_join (MonoNativeThreadId tid)
+{
+ HANDLE handle;
+
+ if (!(handle = OpenThread (THREAD_ALL_ACCESS, TRUE, tid)))
+ return FALSE;
+
+ DWORD res = WaitForSingleObject (handle, INFINITE);
+
+ CloseHandle (handle);
+
+ return res != WAIT_FAILED;
+}
+
#if HAVE_DECL___READFSDWORD==0
static MONO_ALWAYS_INLINE unsigned long long
__readfsdword (unsigned long offset)
void
mono_threads_platform_unregister (MonoThreadInfo *info)
{
- mono_threads_platform_set_exited (info);
+ g_assert (info->handle);
+
+ CloseHandle (info->handle);
+ info->handle = NULL;
}
int
}
void
-mono_threads_platform_set_exited (MonoThreadInfo *info)
-{
- g_assert (info->handle);
- // No need to call CloseHandle() here since the InternalThread
- // destructor will close the handle when the finalizer thread calls it
- info->handle = NULL;
-}
-
-void
-mono_threads_platform_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- g_assert_not_reached ();
-}
-
-void
-mono_threads_platform_disown_mutex (MonoThreadInfo *info, gpointer mutex_handle)
+mono_threads_platform_set_exited (gpointer handle)
{
- g_assert_not_reached ();
}
void