kthread_stop() doesn't use a signal
Posted Jan 12, 2005 17:59 UTC (Wed) by
roman (subscriber, #24157)
Parent article:
Kernel threads made easy
Contrary to the statement in this article, kthread_stop() doesn't send a signal to the kernel thread. It just causes kthread_should_stop() to return TRUE when it is called by the specified thread. This means that (for example) a thread which is blocked in down_interruptible() will not be woken as it would be by a signal. A thread that is to be stopped must call kthread_should_stop() periodically.
It should also be noted that calls to kthread_stop() are serialized. This means that a thread that does not call kthread_should_stop() frequently could cause a delay in stopping other threads. A kernel thread that could be the target of kthread_stop() should be very cautious about calling kthread_stop(), as there is a potential for deadlock.
(
Log in to post comments)