[runtime] Reset the thread_info TLS key if thread registration fails.
authorZoltan Varga <vargaz@gmail.com>
Tue, 19 Jul 2016 18:11:30 +0000 (14:11 -0400)
committerZoltan Varga <vargaz@gmail.com>
Tue, 19 Jul 2016 18:11:30 +0000 (14:11 -0400)
mono/utils/mono-threads.c

index 5b4eaba983b9c1720349f420546c179d4f56f408..ea87586328369550f1e287cbfe8660ef2d1ab099 100644 (file)
@@ -359,6 +359,7 @@ register_thread (MonoThreadInfo *info, gpointer baseptr)
        if (threads_callbacks.thread_register) {
                if (threads_callbacks.thread_register (info, baseptr) == NULL) {
                        // g_warning ("thread registation failed\n");
+                       mono_native_tls_set_value (thread_info_key, NULL);
                        g_free (info);
                        return NULL;
                }