musl/src/thread/pthread_spin_trylock.c

8 lines
129 B
C
Raw Normal View History

2011-02-12 00:22:29 -05:00
#include "pthread_impl.h"
int pthread_spin_trylock(pthread_spinlock_t *s)
{
if (*s || a_xchg(s, 1)) return EBUSY;
return 0;
2011-02-12 00:22:29 -05:00
}