fix more instances of old a_xchg (use new a_swap name)
[musl] / src / thread / pthread_spin_trylock.c
index 1fc5f73..59de695 100644 (file)
@@ -2,6 +2,5 @@
 
 int pthread_spin_trylock(pthread_spinlock_t *s)
 {
-       if (*s || a_xchg(s, 1)) return EBUSY;
-       return 0;
+       return -a_swap(s, 1) & EBUSY;
 }