Question: Given that pthread\_spin\_lock is available, when would I use it, and when should one not use them ?

i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?

Answer: 
The spinlock is a "busy waiting" lock. It's main advantage is that it keeps the thread active and won't cause a context switch, so if you know that you will only be waiting for a very short time (because your critical operation is very quick), then this may give better performance than a mutex. Conversely a mutex will cause less demand on the system if the critical section takes a long time and a context switch is desirable.

TL;DR: It depends.
The safest method with a performance boost is a hybrid of the two: an adaptive mutex.

When your system has multiple cores you spin for a few thousand cycles to capture the best case of low or no contention, then defer to a full mutex to yield to other threads for long contended locks.

Both POSIX (`PTHREAD_MUTEX_ADAPTIVE_NP`) and Win32 (`SetCriticalSectionSpinCount`) have adaptive mutexes, many platforms don't have a POSIX spinlock API.