wait_event_...tible_locked(9)
π€ wait_event_interruptible_locked β the man page, but make it make sense
okay so real talk, this is from the Kernel API Manual, section 9, and the page is literally called wait_event_...tible_locked(9) (yes the ellipsis is doing a lot of work there, that's just how they abbreviate it, don't come for me π
).
β¨ NAME β¨
wait_event_interruptible_locked β sleep until a condition gets true π
Like, actually sleep. Not doomscroll-and-pretend-to-sleep. The kernel kind.
π¦ SYNOPSIS π¦
wait_event_interruptible_locked (wq , condition );
That's it. Two things in, vibes out.
πΈ ARGUMENTS πΈ
wqβ the waitqueue to wait on. this is the queue bestie, the place everyone's hanging out until something happens π«Άconditionβ a C expression for the event to wait for. literally just "keep sleeping until this is true", no cap
π₯ DESCRIPTION π₯
The process is put to sleep (TASK_INTERRUPTIBLE) until the condition evaluates to true or a signal is received. Either one gets you out of bed, so to speak. The condition is checked each time the waitqueue wq is woken up π
it's giving "nap with one eye open" energy and honestly? iconic.
It must be called with wq.lock being held. Not optional, not a suggestion, this is the whole contract bestie. That spinlock is unlocked while sleeping, but the condition testing is done while the lock is held, and when this macro exits, the lock is held again. So it goes: held β unlocked-while-you-snooze β held again by the time you're back. Zero surprises (if you followed the rules) π
The lock is locked/unlocked using spin_lock/spin_unlock functions, which must match the way they are locked/unlocked outside of this macro. fr fr, keep it consistent, don't mix and match, that's how you end up in a very bad mood π
wake_up_locked has to be called after changing any variable that could change the result of the wait condition. Like, change the thing β wake everybody β then everyone re-checks. That's the whole loop. That's the bit. β
The function will return -ERESTARTSYS if it was interrupted by a signal, and 0 if condition evaluated to true π
π§ SEE ALSO π§
Kernel file ./include/linux/wait.h, plus this whole friend group of related calls β yes I'm listing every single one, we don't do "etc." here π
waitqueue_active(9)wq_has_single_sleeper(9)wq_has_sleeper(9)wake_up_pollfree(9)wait_event(9)wait_event_freezable(9)wait_event_timeout(9)wait_event_cmd(9)wait_event_interruptible(9)wait_event_interruptible_timeout(9)wait_event_hrtimeout(9)wait_event_interruptible_hrtimeout(9)wait_event_idle(9)wait_event_idle_exclusive(9)wait_event_idle_timeout(9)wait_event_idle_exclusive_timeout(9)wait_event_interruptible_locked_irq(9)wait_event_interruptible_exclusive_locked(9)wait_event_interruptible_exclusive_locked_irq(9)wait_event_killable(9)wait_event_state(9)wait_event_killable_timeout(9)wait_event_lock_irq_cmd(9)wait_event_lock_irq(9)wait_event_interruptible_lock_irq_cmd(9)wait_event_interruptible_lock_irq(9)wait_event_interruptible_lock_irq_timeout(9)
okay that's the whole page, go forth and hold your locks correctly π
sourced from ./include/linux, dated October 2026, filed under wait_event_...tible_locked(9) β mwah, that's the sign-off, literally obsessed with you for reading this far πβ¨
π¦ 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