Merge pull request #3586 from henricm/fix-win-uri-tests
[mono.git] / mono / utils / mono-threads-windows.c
index 4f8495054334310bb2f7289e8778e657915e59f2..4761af48d0c90507c6fc9433a6b882b05afb804f 100644 (file)
@@ -253,6 +253,17 @@ mono_threads_get_max_stack_size (void)
        return INT_MAX;
 }
 
+gpointer
+mono_threads_platform_duplicate_handle (MonoThreadInfo *info)
+{
+       HANDLE thread_handle;
+
+       g_assert (info->handle);
+       DuplicateHandle (GetCurrentProcess (), info->handle, GetCurrentProcess (), &thread_handle, THREAD_ALL_ACCESS, TRUE, 0);
+
+       return thread_handle;
+}
+
 HANDLE
 mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid)
 {
@@ -324,25 +335,6 @@ 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
 mono_threads_platform_init (void)
 {