From 547ffb85d9251163d6eb7ee5b52ea1db062e064b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 3 Jan 2011 16:29:00 +0000 Subject: [PATCH] Small whitespace nits and add a comment explaining why kthread_exit() can call kproc_exit() that was lost earlier. --- sys/kern/kern_kthread.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index be40c80e9a8..9762d9d90be 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -316,17 +316,20 @@ kthread_exit(void) p = curthread->td_proc; - /* A module may be waiting for us to exit. */ wakeup(curthread); + + /* + * The last exiting thread in a kernel process must tear down + * the whole process. + */ rw_wlock(&tidhash_lock); PROC_LOCK(p); if (p->p_numthreads == 1) { PROC_UNLOCK(p); rw_wunlock(&tidhash_lock); kproc_exit(0); - - /* NOTREACHED. */ + /* NOTREACHED */ } LIST_REMOVE(curthread, td_hash); rw_wunlock(&tidhash_lock);