(rewritten after looking up Linux&#x27;s adaptive mutex)<p>Assuming you mean something like <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;25168942&#x2F;582" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;25168942&#x2F;582</a>, you basically need a full mutex anyway, so I&#x27;m not sure why you wouldn&#x27;t just use a mutex directly. I don&#x27;t think you can really implement this adaptive mutex in userland because you can&#x27;t just use a spinlock + a mutex (you&#x27;d have to lock the mutex every time anyway, which defeats the point of having the spinlock) and syscalls are not considered public API (the kernel is allowed to change syscalls between versions, libc&#x2F;libsystem is the only public API for them).<p>FWIW pthread mutexes were sped up 2-2.5x in &quot;new OSs&quot; to compensate for spinlocks being illegal (<a href="https:&#x2F;&#x2F;twitter.com&#x2F;catfish_man&#x2F;status&#x2F;676852111527706624" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;catfish_man&#x2F;status&#x2F;676852111527706624</a>).