int pthread_spin_trylock(pthread_spinlock_t *lock);
#include <pthread.h> pthread_spinlock_t lock; int ret; ret = pthread_spin_trylock(&lock); /* try to lock the spin lock */