Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Set P_WEXIT earlier; specifically, before a pool_ge...



details:   https://anonhg.NetBSD.org/src/rev/c8d274c215d6
branches:  trunk
changeset: 543294:c8d274c215d6
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Sat Feb 22 01:00:14 2003 +0000

description:
Set P_WEXIT earlier; specifically, before a pool_get(, PR_WAITOK) that
could sleep.

Pointed out by enami.

diffstat:

 sys/kern/kern_exit.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 13a6505bd74e -r c8d274c215d6 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Sat Feb 22 00:53:29 2003 +0000
+++ b/sys/kern/kern_exit.c      Sat Feb 22 01:00:14 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.111 2003/02/21 16:32:19 skrll Exp $    */
+/*     $NetBSD: kern_exit.c,v 1.112 2003/02/22 01:00:14 nathanw Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.111 2003/02/21 16:32:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.112 2003/02/22 01:00:14 nathanw Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -170,6 +170,8 @@
                panic("init died (signal %d, exit %d)",
                    WTERMSIG(rv), WEXITSTATUS(rv));
 
+       p->p_flag |= P_WEXIT;
+
        DPRINTF(("exit1: %d.%d exiting.\n", p->p_pid, l->l_lid));
        /*
         * Disable scheduler activation upcalls. 
@@ -192,7 +194,6 @@
         * If parent is waiting for us to exit or exec, P_PPWAIT is set; we
         * wake up the parent early to avoid deadlock.
         */
-       p->p_flag |= P_WEXIT;
        if (p->p_flag & P_PPWAIT) {
                p->p_flag &= ~P_PPWAIT;
                wakeup((caddr_t)p->p_pptr);



Home | Main Index | Thread Index | Old Index