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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to