**** Reverted this ****
[mono.git] / mono / io-layer / timed-thread.c
index b29ff6410cff6e349bf2bffa14948739e7bc7e2f..58806fdb70d6f09c5db85a4d0f0174c89e0c466c 100644 (file)
@@ -148,6 +148,13 @@ int _wapi_timed_thread_attach(TimedThread **threadp,
        thread->exiting = FALSE;
        thread->id = pthread_self();
 
+       /* Make sure the timed-thread initialisation that the start
+        * routing does happens here too (we might be first to be
+        * called)
+        */
+       mono_once(&timed_thread_once, timed_thread_init);
+       pthread_setspecific(timed_thread_key, (void *)thread);
+
        *threadp = thread;
 
        return(0);