Small whitespace nits and add a comment explaining why kthread_exit() can

call kproc_exit() that was lost earlier.
This commit is contained in:
John Baldwin 2011-01-03 16:29:00 +00:00
parent df06a59a77
commit 547ffb85d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216921

View File

@ -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);