destroy_workqueue(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… destroy_workqueue(9)

okay bestie, welcome to the destroy_workqueue(9) page from the Kernel API Manual β€” this is your group-chat explainer for safely terminating a workqueue. ✨

🌸 NAME

destroy_workqueue β€” safely terminate a workqueue. periodt. πŸ’–

✨ SYNOPSIS

void destroy_workqueue (struct workqueue_struct *wq );

πŸŽ€ ARGUMENTS

  • wq β€” target workqueue. 🎯

πŸ¦‹ DESCRIPTION

okay so when you call this, you are asking the kernel to safely destroy a workqueue, and the vibe is: all work currently pending will be done first. like, it lets the currently pending stuff finish before the workqueue dips. πŸ’…

⚠️ big important catch, no cap: this function does NOT guarantee that non-pending work that has been submitted with queue_delayed_work and similar functions will be done before destroying the workqueue. 😭

here’s the fundamental problem: currently, the workqueue has no way of accessing non-pending delayed_work. delayed_work is only linked on the timer-side. so all delayed_work must, therefore, be canceled before calling this function. fr fr, do not skip that part. 🫢

TODO: it would be better if the problem described above wouldn’t exist and destroy_workqueue would cleanly cancel all pending and non-pending delayed_work. we love a future-improvement note. ✨

πŸ’– SEE ALSO

Kernel file ./kernel/workqueue.c is the source-file main character, and here’s the full SEE ALSO roll call β€” every single one, in order, no skips:


signed off by source/version ./kernel, dated October 2026 β€” destroy_workqueue(9) πŸ’–

πŸ“¦ where this page comes from