28.7.1.1. Userland mutex implementation

The best article to understand spinlocks is: https://eli.thegreenplace.net/2018/basics-of-futexes/

The example in man futex is also a must.