Merge pull request #615 from nealef/master
[mono.git] / mono / utils / mono-threads-windows.c
index ae039da39425c3fe1b94e09110738b8d30526f8e..4ed9dd13f99b4944e2791c1ad0abf48937640f0c 100644 (file)
@@ -83,7 +83,7 @@ inner_start_thread (LPVOID arg)
        gboolean suspend = start_info->suspend;
        HANDLE suspend_event = start_info->suspend_event;
 
-       mono_thread_info_attach (&result);
+       mono_thread_info_attach (&result)->runtime_thread = TRUE;
 
        post_result = MONO_SEM_POST (&(start_info->registered));
        g_assert (!post_result);
@@ -98,6 +98,8 @@ inner_start_thread (LPVOID arg)
 
        g_assert (!mono_domain_get ());
 
+       mono_thread_info_dettach ();
+
        return result;
 }