wait_var_event_mutex(9)
π NAME π
okay bestie, welcome to the Kernel API Manual page for wait_var_event_mutex(9) β it's literally the βwait for a variable to be updated under a mutexβ icon. π
wait_var_event_mutex β wait for a variable to be updated under a mutex. slay.
πΈ SYNOPSIS πΈ
wait_var_event_mutex (var , condition , lock );
π ARGUMENTS π
varβ the address of the variable being waited on, bestie. literally the address.conditionβ condition to wait for. yes ma'am.lockβ the mutex which protects updates to the variable. it's giving bodyguard energy.
π¦ DESCRIPTION π¦
okay so picture this: you're waiting for a condition which can only be reliably tested while holding a mutex. the variables assessed in the condition will normal be updated under the same mutex, and the wake up should be signalled with wake_up_var_locked under the same mutex. π«Ά
this is similar to wait_var_event, but assumes a mutex is held while calling this function and while updating the variable. lowkey a whole vibe.
this must be called while the given mutex is held and the mutex will be dropped when schedule is called to wait for a wake up, and will be reclaimed before testing the condition again. no cap, that's the whole flow. π
π SEE ALSO π
the whole friend group lives in the Kernel file ./include/linux/wait_bit.h: wait_on_bit(9), wait_on_bit_io(9), wait_on_bit_timeout(9), wait_on_bit_action(9), wait_on_bit_lock(9), wait_on_bit_lock_io(9), wait_on_bit_lock_action(9), wait_var_event(9), wait_var_event_io(9), wait_var_event_killable(9), wait_var_event_timeout(9), wait_var_event_interruptible(9), wait_var_event_any_lock(9), wait_var_event_spinlock(9), wake_up_var_protected(9), wake_up_var_locked(9), clear_and_wake_up_bit(9), test_and_clear_wake_up_bit(9), atomic_dec_and_wake_up(9), and store_release_wake_up(9). β¨
bye bestie π«Ά β source/version: ./include/linux; date: October 2026; and yes, it's the wait_var_event_mutex(9) page. mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms