Linux's futex(2) syscall, introduced in kernel 2.5.7, is the mechanism glibc's `sem_t` and `pthread_mutex_t` are built on today precisely because it avoids a syscall on the uncontended fast path, which is why futex-based locks vastly outperform SysV semaphores under light contention. This same primitive underlies Rust's `parking_lot` and Java's `LockSupport.park()`, and the spurious-wakeup handling you implement here is required by the futex(2) man page itself.