Upon successful completion, the pthread_spin_init() function returns 0. Otherwise, one of the following error codes is returned.
The system lacks the necessary resources to initialize another spin lock.
The system has detected an attempt to initialize or destroy a spin lock while the lock is in use (for example, while being used in a pthread_spin_lock() call) by another thread.
The value specified by lock is invalid.