Module Name:    src
Committed By:   yamt
Date:           Fri May  8 13:32:59 UTC 2009

Modified Files:
        src/sys/kern: kern_exit.c

Log Message:
exit1: fix a race with do_sys_wait/proc_free.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/kern/kern_exit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.220 src/sys/kern/kern_exit.c:1.221
--- src/sys/kern/kern_exit.c:1.220	Sat Apr 25 15:06:31 2009
+++ src/sys/kern/kern_exit.c	Fri May  8 13:32:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exit.c,v 1.220 2009/04/25 15:06:31 rmind Exp $	*/
+/*	$NetBSD: kern_exit.c,v 1.221 2009/05/08 13:32:59 yamt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.220 2009/04/25 15:06:31 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.221 2009/05/08 13:32:59 yamt Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -543,8 +543,8 @@
 	 * Drop debugger/procfs lock; no new references can be gained.
 	 */
 	cv_broadcast(&p->p_pptr->p_waitcv);
-	mutex_exit(proc_lock);
 	rw_exit(&p->p_reflock);
+	mutex_exit(proc_lock);
 
 	/* Verify that we hold no locks other than the kernel lock. */
 	LOCKDEBUG_BARRIER(&kernel_lock, 0);

Reply via email to