rework langinfo code for ABI compat and for use by time code
[musl] / src / thread / pthread_detach.c
index e803239..651c38e 100644 (file)
@@ -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;
 }