wait_event_freezable(9)
π€ wait_event_freezable(9) β like, the Kernel API Manual page you didn't know you needed π€
okay so bestie, welcome to the Kernel API Manual β¨ this one is called wait_event_freezable, and it's genuinely one of the cutest little sleepers in the whole tree. it's giving "nap until the vibes are correct" π
πΈ NAME πΈ
wait_event_freezable β sleep (or freeze) until a condition gets true π΄π¦
β¨ SYNOPSIS β¨
wait_event_freezable (wq_head , condition );
no cap, that's the whole thing. two args. go off π
π ARGUMENTS π
wq_headβ the waitqueue to wait on ποΈ like, the actual queue you're gonna crash on. this is your bed, basically.conditionβ a C expression for the event to wait for π that's the thing you're lowkey obsessed with: your thread stays sleeping until this evaluates to true.
π DESCRIPTION π
okay so here's the tea π the process gets put to sleep β specifically in TASK_INTERRUPTIBLE, which is the whole point, so as not to contribute to system load π«Ά like, she's asleep, she's not out here burning CPU cycles, she's minding her business. icon behavior, honestly.
she sleeps until the condition evaluates to true. and the condition gets checked each and every time the waitqueue wq_head is woken up β so it's not a one-and-done vibe check, it's a re-check every wakeup. very thorough. we love a diligent queen π
and now the part you actually need to remember, bestie, because this is the part people fumble π: wake_up has to be called after changing any variable that could change the result of the wait condition. like β if you flip the variable and then just don't call wake_up, your sleeper is gonna be asleep forever and that's not a slay, that's a hang π fr fr, do not forget the wakeup.
β οΈ reminder: change the variable β call wake_up. every time. that's the deal. no wakeup, no progress. periodt.
π¦ SEE ALSO π¦
all of these live in the kernel file ./include/linux/wait.h β go read the whole fam, they're all iconic in their own way π
waitqueue_active(9)wq_has_single_sleeper(9)wq_has_sleeper(9)wake_up_pollfree(9)wait_event(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)wait_event_interruptible_lock_irq_timeout(9)
and that's the whole page, bestie π§π mwah. this lil' cutie lives at ./include/linux, dated October 2026, and it's filed under wait_event_freezable(9) β go take a nap, you've earned it πβ¨π«Ά
π¦ 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