int pthread_spin_init (pthread_spinlock_t *lock, int pshared); int pthread_spin_destroy (pthread_spinlock_t *lock); int pthread_spin_lock (pthread_spinlock_t *lock); int pthread_spin_trylock (pthread_spinlock_t *lock); int pthread_spin_unlock (pthread_spinlock_t *lock);
PTHREAD_PROCESS_PRIVATE - only for threads from the same process
PTHREAD_PROCESS_SHARED - for any thread that can access the memory with the lock