kthread_destroy_worker(9)
π kthread_destroy_worker(9) β from the Kernel API Manual, bestie π
okay so real talk, this one's from the kernel API manual and it's lowkey such a vibe cleanup function. it's called kthread_destroy_worker and yes the name is literally the whole plot π«Ά
β¨ NAME β¨
kthread_destroy_worker β destroy a kthread worker πβ¨
πΈ SYNOPSIS πΈ
void kthread_destroy_worker (struct kthread_worker *worker );
π¦ ARGUMENTS π¦
workerβ the worker to be destroyed. yeah. that's the one. say bye π
π DESCRIPTION π
So what it does is: flush and destroy worker. that's it, that's the function. β¨
And ngl the flush situation is chill β a simple flush is enough, because the kthread worker API is only used in trivial scenarios. there are no multi-step state machines needed here. none. zero. not a single one. we love a low-maintenance API π
β οΈ ok bestie listen, this part matters: this function is not responsible for handling delayed work. so the caller has to be responsible for queuing or canceling all delayed work items before invoking this function. you cannot just roll up and expect it to clean up your delayed work for you, that's not the vibe check it passes π
π SEE ALSO π
- Kernel file
./kernel/kthread.c kthread_should_stop(9)kthread_should_park(9)kthread_freezable_should_stop(9)kthread_func(9)kthread_data(9)kthread_probe_data(9)kthread_complete_and_exit(9)kthread_create_on_node(9)kthread_bind(9)kthread_create_on_cpu(9)kthread_unpark(9)kthread_park(9)kthread_stop(9)kthread_stop_put(9)kthread_affine_preferred(9)kthreads_update_housekeeping(9)kthread_worker_fn(9)kthread_create_worker_on_node(9)kthread_create_worker_on_cpu(9)kthread_queue_work(9)kthread_delayed_work_timer_fn(9)kthread_queue_delayed_work(9)kthread_flush_work(9)kthread_mod_delayed_work(9)kthread_cancel_work_sync(9)kthread_cancel_delayed_work_sync(9)kthread_flush_worker(9)kthread_use_mm(9)kthread_unuse_mm(9)kthread_associate_blkcg(9)kthread_blkcg(9)
like that's the whole reading list, it's giving syllabus energy fr fr ππ
kisses, this page came from the <code>./kernel</code> source and it's dated October 2026 β drink water, cancel your delayed work, and slay π§ββοΈπ
π¦ 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