svn commit: r234381 - head/sys/kern

Edward Tomasz Napierala trasz at FreeBSD.org
Tue Apr 17 13:44:41 UTC 2012


Author: trasz
Date: Tue Apr 17 13:44:40 2012
New Revision: 234381
URL: http://svn.freebsd.org/changeset/base/234381

Log:
  Fix panic, triggered like this: "int main() { thr_exit(); }"
  
  Submitted by:	Mateusz Guzik

Modified:
  head/sys/kern/kern_thr.c

Modified: head/sys/kern/kern_thr.c
==============================================================================
--- head/sys/kern/kern_thr.c	Tue Apr 17 13:28:14 2012	(r234380)
+++ head/sys/kern/kern_thr.c	Tue Apr 17 13:44:40 2012	(r234381)
@@ -317,13 +317,13 @@ sys_thr_exit(struct thread *td, struct t
 	rw_wlock(&tidhash_lock);
 
 	PROC_LOCK(p);
-	racct_sub(p, RACCT_NTHR, 1);
 
 	/*
 	 * Shutting down last thread in the proc.  This will actually
 	 * call exit() in the trampoline when it returns.
 	 */
 	if (p->p_numthreads != 1) {
+		racct_sub(p, RACCT_NTHR, 1);
 		LIST_REMOVE(td, td_hash);
 		rw_wunlock(&tidhash_lock);
 		tdsigcleanup(td);


More information about the svn-src-head mailing list