title: Best equivalent for EnterCriticalSection on Mac OS X?
body: <p>What's the best equivalent? I didn't find any reasonable solution for such a simple function. Choices I'm aware of:</p>
  
  <p>1) MPEnterCriticalRegion - this is unfortunately extremely ineffective, probably because despite it's name it enters kernel mode, so for repeating locks it just takes way too much time...</p>
  
  <p>2) OSSpinLockLock - unusable, because apparently not recursive. If it would be recursive, it would be the correct equivalent.</p>
  
  <p>3) pthread_mutex_lock - didn't try, but I don't expect much, because it will probably be just emulated using the critical region or another system resource.</p>