12345678910111213141516171819202122232425262728 |
- #include <errno.h>
- #include "pthreadP.h"
- int
- pthread_spin_trylock (pthread_spinlock_t *lock)
- {
- int res;
- __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (res) : "r" (lock) : "memory");
- return res == 0 ? 0 : EBUSY;
- }
|