2005-08-03 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / libgc / solaris_pthreads.c
index bae77193593f5e963ccd7b1531f3bb774840a802..819454b439fc1016df0d3e835784fd9da08c53b6 100644 (file)
@@ -63,6 +63,22 @@ int GC_pthread_join(pthread_t wait_for, void **status)
        return GC_thr_join((thread_t)wait_for, NULL, status);
 }
 
+int GC_pthread_detach(pthread_t thread)
+{
+       GC_thread t;
+
+       LOCK();
+       t=GC_lookup_thread(thread);     
+       UNLOCK();
+       if (t) {
+               LOCK();
+               t->flags |= DETACHED;
+               UNLOCK();
+               return 0;
+       }
+       else
+               return pthread_detach(thread);
+}
 
 int
 GC_pthread_create(pthread_t *new_thread,