1 #include "pthread_impl.h"
4 int __pthread_join(pthread_t, void **);
6 static int __pthread_detach(pthread_t t)
8 /* Cannot detach a thread that's already exiting */
9 if (a_swap(t->exitlock, 1))
10 return __pthread_join(t, 0);
12 a_store(t->exitlock, 0);
13 __wake(t->exitlock, 1, 1);
17 weak_alias(__pthread_detach, pthread_detach);
18 weak_alias(__pthread_detach, thrd_detach);