X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_detach.c;h=8ef03d514147c12a2408a1ca37e08bf1998751ae;hp=f0eae3e8eb91e04e1a2e46397a9fa674db02fbf6;hb=2b71a4d1dfb0487cc2558df646a262ffb8261585;hpb=813d37839b97960d38f10ea93d9c4a391c1c91a5 diff --git a/src/thread/pthread_detach.c b/src/thread/pthread_detach.c index f0eae3e8..8ef03d51 100644 --- a/src/thread/pthread_detach.c +++ b/src/thread/pthread_detach.c @@ -3,7 +3,7 @@ int pthread_detach(pthread_t t) { /* Cannot detach a thread that's already exiting */ - if (a_xchg(&t->exitlock, 1)) + if (a_swap(&t->exitlock, 1)) return pthread_join(t, 0); t->detached = 1; t->exitlock = 0;