[email protected] (Paul Goyette) writes:
>>> Is there a reason for not providing kthread_destroy()? How difficult
>>> would it be to add it?
>> The right thing to use is kthread_exit().
>Doesn't kthread_exit() need to be called from within the victim/target ?
>Would it be "reasonable" (for some value thereof) for the module cleanup
>routine to set a flag "please_exit" and then call kthread_join(). Then
>the target thread can check the flag and exit if set.
That's what sysmon does in sysmon_task_queue_fini(). Set a flag and
signal the thread to exit, then wait until the thread has cleared
the flag again to ensure that the thread has exited.
kthread_join() would have done the same thing.
--
--
Michael van Elst
Internet: [email protected]
"A potential Snark may lurk in every tree."