Great article from 2016 that goes in great depth about how locks are implemented in Webkit.

In short:

Mutex are too memory consuming and too slow, futex are too specific to Linux, and spinlocks consume too much CPU cycles for their use case: high variance in lock acquisition duration. So using atomic CAS (compare-and-swap) operation they are able to create an adaptative lock that will spin in the beginning and behave like a mutex if the lock in not acquired fast enough.

I was wondering if it was possible to do real time statistical analysis to even improve the time between two acquisition attempt. Might be too resource consuming, we could give a try one day.