Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2012 11:43:33 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r235900 - stable/9/sys/kern
Message-ID:  <201205241143.q4OBhXih035901@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Thu May 24 11:43:33 2012
New Revision: 235900
URL: http://svn.freebsd.org/changeset/base/235900

Log:
  MFC r234381:
  
  Fix panic, triggered like this: "int main() { thr_exit(); }"

Modified:
  stable/9/sys/kern/kern_thr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_thr.c
==============================================================================
--- stable/9/sys/kern/kern_thr.c	Thu May 24 11:24:44 2012	(r235899)
+++ stable/9/sys/kern/kern_thr.c	Thu May 24 11:43:33 2012	(r235900)
@@ -316,13 +316,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);



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