* [PATCH] update the comment in kthread_stop()
@ 2009-07-23 14:13 Rusty Russell
0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2009-07-23 14:13 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, Oleg Nesterov
Date: Fri, 19 Jun 2009 02:51:13 +0200
From: Oleg Nesterov <oleg@redhat.com>
"kthreads: rework kthread_stop()"
commit 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 removed the limitation,
but forgot to update the comment.
Since that commit it is OK to use kthread_stop() even if kthread can exit
itself.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
kernel/kthread.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff -u
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -180,10 +180,12 @@ EXPORT_SYMBOL(kthread_bind);
* @k: thread created by kthread_create().
*
* Sets kthread_should_stop() for @k to return true, wakes it, and
- * waits for it to exit. Your threadfn() must not call do_exit()
- * itself if you use this function! This can also be called after
- * kthread_create() instead of calling wake_up_process(): the thread
- * will exit without calling threadfn().
+ * waits for it to exit. This can also be called after kthread_create()
+ * instead of calling wake_up_process(): the thread will exit without
+ * calling threadfn().
+ *
+ * If threadfn() may call do_exit() itself, the caller must ensure
+ * task_struct can't go away.
*
* Returns the result of threadfn(), or %-EINTR if wake_up_process()
* was never called.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-07-23 14:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23 14:13 [PATCH] update the comment in kthread_stop() Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox