fix stale locks left behind when pthread_create fails
[musl] / src / thread / pthread_spin_trylock.c
index c12696b..59de695 100644 (file)
@@ -2,5 +2,5 @@
 
 int pthread_spin_trylock(pthread_spinlock_t *s)
 {
-       return -a_xchg(s, 1) & EBUSY;
+       return -a_swap(s, 1) & EBUSY;
 }