Merge branch 'BigIntegerParse'
[mono.git] / mono / utils / mono-threads.c
index 5138427ed7c5c2de57d11eaffaa84d4420ef4af4..d56564f86a7f419bce39ac4434d85351fa301435 100644 (file)
@@ -168,6 +168,8 @@ unregister_thread (void *arg)
 
        THREADS_DEBUG ("unregistering info %p\n", info);
 
+       mono_threads_core_unregister (info);
+
        /*
         * TLS destruction order is not reliable so small_id might be cleaned up
         * before us.
@@ -284,14 +286,14 @@ mono_thread_info_attach (void *baseptr)
 }
 
 void
-mono_thread_info_dettach (void)
+mono_thread_info_detach (void)
 {
        MonoThreadInfo *info;
        if (!mono_threads_inited)
        {
                /* This can happen from DllMain(THREAD_DETACH) on Windows, if a thread
                 * is created before an embedding API user initialized Mono. */
-               THREADS_DEBUG ("mono_thread_info_dettach called before mono_threads_init\n");
+               THREADS_DEBUG ("mono_thread_info_detach called before mono_threads_init\n");
                return;
        }
        info = mono_native_tls_get_value (thread_info_key);
@@ -745,3 +747,28 @@ mono_thread_info_tls_set (THREAD_INFO_TYPE *info, MonoTlsKey key, gpointer value
 {
        ((MonoThreadInfo*)info)->tls [key] = value;
 }
+
+/*
+ * mono_thread_info_exit:
+ *
+ *   Exit the current thread.
+ * This function doesn't return.
+ */
+void
+mono_thread_info_exit (void)
+{
+       mono_threads_core_exit (0);
+}
+
+/*
+ * mono_thread_info_open_handle:
+ *
+ *   Return a io-layer/win32 handle for the current thread.
+ * The handle need to be closed by calling CloseHandle () when it is no
+ * longer needed.
+ */
+HANDLE
+mono_thread_info_open_handle (void)
+{
+       return mono_threads_core_open_handle ();
+}