musl/src/thread/pthread_spin_lock.c
Rich Felker 117581ca69 fix broken spinlock due to miscompilation
actually this trick also seems to have made the uncontended case slower.
2011-03-28 22:22:54 -04:00

7 lines
110 B
C

#include "pthread_impl.h"
int pthread_spin_lock(pthread_spinlock_t *s)
{
while (a_xchg(s, 1));
return 0;
}