X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_detach.c;h=ed77f74d520bff3a16ef5e055f08bbf021fe91d4;hb=385c01112c083eb383d972da45836d497cc0556d;hp=651c38ebe86cc82ce51aca57731da21c48851e73;hpb=bbbe87e35cfeef593e23010e35528e722027567f;p=musl diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c index 651c38eb..ed77f74d 100644 --- a/src/thread/pthread_detach.c +++ b/src/thread/pthread_detach.c @@ -1,11 +1,17 @@ #include "pthread_impl.h" +#include -int pthread_detach(pthread_t t) +int __pthread_join(pthread_t, void **); + +static int __pthread_detach(pthread_t t) { /* Cannot detach a thread that's already exiting */ if (a_swap(t->exitlock, 1)) - return pthread_join(t, 0); + return __pthread_join(t, 0); t->detached = 2; __unlock(t->exitlock); return 0; } + +weak_alias(__pthread_detach, pthread_detach); +weak_alias(__pthread_detach, thrd_detach);