Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jan 2011 16:29:00 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216921 - head/sys/kern
Message-ID:  <201101031629.p03GT0Ar098280@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101031629.p03GT0Ar098280>