1 #include "threads_impl.h" 2 #include <errno.h> 3 pthread_spin_lock(pthread_spinlock_t * s)4int pthread_spin_lock(pthread_spinlock_t* s) { 5 while (atomic_load(s) || a_cas_shim(s, 0, EBUSY)) 6 a_spin(); 7 return 0; 8 } 9
1 #include "threads_impl.h" 2 #include <errno.h> 3 pthread_spin_lock(pthread_spinlock_t * s)4int pthread_spin_lock(pthread_spinlock_t* s) { 5 while (atomic_load(s) || a_cas_shim(s, 0, EBUSY)) 6 a_spin(); 7 return 0; 8 } 9