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_describe (MonoThreadInfo *info, GString *text)
+mono_threads_platform_set_exited (gpointer handle)
{
- /* TODO */
-}
-
-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)
-{
- g_assert_not_reached ();
-}
-
-MonoThreadPriority
-mono_threads_platform_get_priority (MonoThreadInfo *info)
-{
- g_assert (info->handle);
- return GetThreadPriority (info->handle) + 2;
-}
-
-void
-mono_threads_platform_set_priority (MonoThreadInfo *info, MonoThreadPriority priority)
-{
- BOOL res;
-
- g_assert (info->handle);
-
- res = SetThreadPriority (info->handle, priority - 2);
- if (!res)
- g_error ("%s: SetThreadPriority failed, error %d", __func__, GetLastError ());
}
void