X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_detach.c;h=651c38ebe86cc82ce51aca57731da21c48851e73;hp=e80323982dd91704c47c7588896f288b47edc18b;hb=HEAD;hpb=92f8396b0c8e4f146563b87f46137484cfb36e31 diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c index e8032398..651c38eb 100644 --- a/src/thread/pthread_detach.c +++ b/src/thread/pthread_detach.c @@ -3,9 +3,9 @@ int pthread_detach(pthread_t t) { /* Cannot detach a thread that's already exiting */ - if (a_swap(&t->exitlock, 1)) + if (a_swap(t->exitlock, 1)) return pthread_join(t, 0); t->detached = 2; - a_store(&t->exitlock, 0); + __unlock(t->exitlock); return 0; }