task_work_cancel_func(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… task_work_cancel_func β€” the kernel API manual, bestie edition ✨

okay so real talk, this is task_work_cancel_func(9) from the Kernel API Manual and it's genuinely one of those little helpers that eats, no cap πŸŽ€


✨ NAME ✨

task_work_cancel_func β€” cancels a pending work that matches a function you added with task_work_add() 🫢

like, you queued a thing, and now you're like "actually no" and this is the function that handles that for you. iconic behavior honestly πŸ’…


🌸 SYNOPSIS 🌸

struct callback_head * task_work_cancel_func (struct task_struct *task ,
       task_work_func_t func );

she takes two arguments and gives you back a struct callback_head *. that's the whole vibe ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • task β€” the task that should execute the func's work. yes, that task. the one whose queue we're rummaging through 🧚
  • func β€” this is the identifier, bestie. it's what gets matched against a work so we know which one to remove πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• β€” task_work_cancel_func goes looking for the last queued pending work where ->func == func, and then it removes it from the queue. bye bye πŸ‘‹

not the first one. the last one. the way that detail matters... iykyk πŸ”₯


⭐ RETURN ⭐

you get back the found work β€” or NULL if nothing was found 😭 (yeah, she'll tell you straight up if the search came up empty, no sugarcoating)


🌈 SEE ALSO 🌈


heads up bestie: if the work isn't there, you're getting NULL back and that's just how it is. plan accordingly πŸ™ˆ

and that's the whole page fr fr πŸ’– this one lives under ./kernel, brought to you by the Kernel API Manual, dated October 2026 β€” go off, queen πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from