svn commit: r216921 - head/sys/kern

John Baldwin jhb at FreeBSD.org
Mon Jan 3 16:29:00 UTC 2011


Author: jhb
Date: Mon Jan  3 16:29:00 2011
New Revision: 216921
URL: http://svn.freebsd.org/changeset/base/216921

Log:
  Small whitespace nits and add a comment explaining why kthread_exit() can
  call kproc_exit() that was lost earlier.

Modified:
  head/sys/kern/kern_kthread.c

Modified: head/sys/kern/kern_kthread.c
==============================================================================
--- head/sys/kern/kern_kthread.c	Mon Jan  3 15:31:02 2011	(r216920)
+++ head/sys/kern/kern_kthread.c	Mon Jan  3 16:29:00 2011	(r216921)
@@ -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);


More information about the svn-src-all mailing list