wait_event_..._irq_timeout(9)
wait_event_..._irq_timeout(9) π
β¨
Okay so this is from the Kernel API Manual, and it's the page for wait_event_interruptible_lock_irq_timeout β literally the function that puts your process to sleep until a condition gets true or a timeout elapses. The condition is checked under the lock, and this is expected to be called with the lock taken, periodt. π«Ά
π NAME π
wait_event_interruptible_lock_irq_timeout β sleep until a condition gets true or a timeout elapses. The condition is checked under the lock. This is expected to be called with the lock taken. No cap, that lock detail is the whole vibe. π
β¨ SYNOPSIS β¨
Here's the exact call, bestie β do not freestyle the spacing, I'm begging:
wait_event_interruptible_lock_irq_timeout (wq_head , condition , lock ,
timeout );
π ARGUMENTS π
Argument vibe check, one by one:
wq_headβ the waitqueue to wait on. This is the main character waitqueue, okay? πconditionβ a C expression for the event to wait for. Like, the thing your whole nap is about. π€lockβ a lockedspinlock_t, which will be released before schedule and reacquired afterwards. Yes, it really does the lock handoff. πtimeoutβ timeout, in jiffies. That's the unit, bestie, keep it exact. β³
π¦ DESCRIPTION π¦
Okay so the process is put to sleep (TASK_INTERRUPTIBLE) until condition evaluates to true or a signal is received. The condition is checked each time the waitqueue wq_head is woken up. It's giving "nap, but make it event-driven." π΄β¨
wake_up has to be called after changing any variable that could change the result of the wait condition. This is not optional, fr fr. Like, if you change the thing and don't wake it up, that's not slay behavior. π¨
This is supposed to be called while holding the lock. The lock is dropped before going to sleep and is reacquired afterwards. So it's lowkey a trust fall with the lock β except the kernel is the one catching you. π«Ά
Return-value tea, and it's important:
0if the timeout elapsed.-ERESTARTSYSif it was interrupted by a signal.- the remaining jiffies otherwise, if the condition evaluated to true before the timeout elapsed.
That's the whole return vibe check. Slay, now you know what you're getting back. π
π SEE ALSO π
Kernel file: ./include/linux/wait.h β and the whole waitqueue squad is here, no gatekeeping:
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(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)
Byeee bestie π β source: ./include/linux, date: October 2026, page: wait_event_..._irq_timeout(9). π
π¦ 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