X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_detach.c;h=77772af2c6349fca2cd66860c71e910c3138b101;hb=a75283d777ed1827ed247dbb465818a0ce371c8f;hp=9cee7a89c3f944b214d96c5f372c9c7942d60328;hpb=cdba6b2562bc5c2078e0e1e6f86c8835a42ae4ff;p=musl diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c index 9cee7a89..77772af2 100644 --- a/src/thread/pthread_detach.c +++ b/src/thread/pthread_detach.c @@ -1,13 +1,11 @@ #include "pthread_impl.h" #include -int __pthread_join(pthread_t, void **); - static int __pthread_detach(pthread_t t) { /* If the cas fails, detach state is either already-detached * or exiting/exited, and pthread_join will trap or cleanup. */ - if (a_cas(&t->detach_state, DT_JOINABLE, DT_DYNAMIC) != DT_JOINABLE) + if (a_cas(&t->detach_state, DT_JOINABLE, DT_DETACHED) != DT_JOINABLE) return __pthread_join(t, 0); return 0; }