The __lock
member of struct __pthread_mutex_s
__data
is used as a futex object on Linux. Many of the following details may differ depending on the architecture you're looking at:
See the pthread_mutex_lock.c
code for the high level locking function for pthread mutexes - __pthread_mutex_lock()
, which generally will end up calling LLL_MUTEX_LOCK()
and the definitions of LLL_MUTEX_LOCK()
and friends, which end up calling lll_lock()
, etc., in lowlevellock.h
.
The lll_lock()
macro in turn calls __lll_lock_wait_private()
, which calls lll_futex_wait()
, which makes the sys_futex
system call.