disable_work(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… disable_work β€” Kernel API Manual ✨

okay bestie, buckle up, because today we're talking about disable_work(9) β€” the kernel workqueue function that says "nope, not right now" to a work item πŸŽ€


🌸 NAME 🌸

disable_work β€” Disable and cancel a work item, fr fr πŸ’…


✨ SYNOPSIS ✨

bool disable_work (struct work_struct *work );

like, that's the whole signature. short and iconic πŸ‘‘


🫢 ARGUMENTS 🫢

  • work β€” the work item you wanna disable. that's it, that's the vibe πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” disable_work disables your work by incrementing its disable count, and it also cancels that work if it's currently pending. like, it's not just sitting there pretending, it actually goes and cancels it. main character energy πŸ”₯

and because the disable count is now non-zero, any attempt to queue that work will fail and return false. periodt. no queueing, no vibes, nothing πŸ’€

the maximum supported disable depth is 2 to the power of WORK_OFFQ_DISABLE_BITS, which is currently 65536. highkey a big number, don't push your luck bestie πŸ™ˆ

you can call this from any context β€” literally any. and it returns true if the work was pending, false otherwise. easy ⭐


πŸ‘‘ SEE ALSO πŸ‘‘

okay this list is LONG but we respect the lore. all of these live in the kernel file ./kernel/workqueue.c β€” go read it, iykyk:


that's the whole page bestie, no cap. this one came out of ./kernel and it's dated October 2026 β€” so like, from the future?? we love a timeless queen πŸ§šπŸ’œ bye!! πŸ“

πŸ“¦ where this page comes from