Lock doesn't have to sleep. The semantic of a lock is that on acquisition it blocks until it's available, and upon unblocking the caller thread has acquired the lock. The blocking can be sleep or be doing busy-spin.
Futex is the lower level mechanism to build higher level locks like mutex/semphore/conditional-variable/etc.
Futex is the lower level mechanism to build higher level locks like mutex/semphore/conditional-variable/etc.