OSX requires a comma after segment name. The segment name must also not
be longer than 16 characters.
There is no pthread_spin_lock on OSX. We could consider using mutexes
instead, but this is a drop-in replacement.

See https://idea.popcount.org/2012-09-12-reinventing-spinlocks/
Similarly, there is no timed lock. Here is an example that references an
implementation from Mono:
http://aleksmaus.blogspot.nl/2011/12/missing-pthreadmutextimedlock-on.html
Built-in functions require us to be permissive.