remove LFS64 symbol aliases; replace with dynamic linker remapping
[musl] / src / thread / pthread_spin_lock.c
index 59fa6ea..ded2b65 100644 (file)
@@ -1,7 +1,8 @@
 #include "pthread_impl.h"
+#include <errno.h>
 
 int pthread_spin_lock(pthread_spinlock_t *s)
 {
-       while (a_xchg(s, 1));
+       while (*(volatile int *)s || a_cas(s, 0, EBUSY)) a_spin();
        return 0;
 }