2002-04-30 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / timed-thread.c
index 537a609aa4e48cd32e997e8c45712f1c947257af..7fdf89322f880698bf08de13c14a821b817324b4 100644 (file)
@@ -73,6 +73,7 @@ static void *timed_thread_start_routine(gpointer args)
        
        pthread_once(&timed_thread_once, timed_thread_init);
        pthread_setspecific(timed_thread_key, (void *)thread);
+       pthread_detach(thread->id);
        _wapi_timed_thread_exit(thread->start_routine(thread->arg));
 }
 
@@ -107,7 +108,6 @@ int _wapi_timed_thread_create(TimedThread **threadp,
                return(result);
        }
        
-       pthread_detach(thread->id);
        return(0);
 }
 
@@ -142,3 +142,10 @@ int _wapi_timed_thread_join(TimedThread *thread, struct timespec *timeout,
        return(result);
 }
 
+void _wapi_timed_thread_destroy (TimedThread *thread)
+{
+       mono_mutex_destroy (&thread->join_mutex);
+       pthread_cond_destroy (&thread->exit_cond);
+       
+       g_free(thread);
+}