musl/src/thread/pthread_spin_trylock.c
2011-03-24 23:06:08 -04:00

8 lines
129 B
C

#include "pthread_impl.h"
int pthread_spin_trylock(pthread_spinlock_t *s)
{
if (*s || a_xchg(s, 1)) return EBUSY;
return 0;
}