Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Call exit_lwps() from exit1() if there is more than...



details:   https://anonhg.NetBSD.org/src/rev/549af8223db8
branches:  trunk
changeset: 542387:549af8223db8
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Mon Jan 27 20:30:32 2003 +0000

description:
Call exit_lwps() from exit1() if there is more than one LWP (as
recorded by p_nlwps) *or* if the process was a SA process. Since
cached SA LWPs aren't counted in p_nlwps, it was possible for
them to not be cleaned up and remain on the alllwp list, pointing to a
dead proc.

diffstat:

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

diffs (48 lines):

diff -r 5ca56e20d448 -r 549af8223db8 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Mon Jan 27 20:18:11 2003 +0000
+++ b/sys/kern/kern_exit.c      Mon Jan 27 20:30:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.107 2003/01/18 10:06:26 thorpej Exp $  */
+/*     $NetBSD: kern_exit.c,v 1.108 2003/01/27 20:30:32 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.107 2003/01/18 10:06:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.108 2003/01/27 20:30:32 nathanw Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -162,7 +162,7 @@
 exit1(struct lwp *l, int rv)
 {
        struct proc     *p, *q, *nq;
-       int             s;
+       int             s, sa;
 
        p = l->l_proc;
 
@@ -175,9 +175,11 @@
         * Disable scheduler activation upcalls. 
         * We're trying to get out of here. 
         */
+       sa = 0;
        if (l->l_flag & L_SA) {
                l->l_flag &= ~L_SA;
                p->p_flag &= ~P_SA;
+               sa = 1;
        }
 
 #ifdef PGINPROF
@@ -200,7 +202,7 @@
        p->p_sigctx.ps_sigcheck = 0;
        timers_free(p, TIMERS_ALL);
 
-       if (p->p_nlwps > 1)
+       if (sa || (p->p_nlwps > 1))
                exit_lwps(l);
 
 #if defined(__HAVE_RAS)



Home | Main Index | Thread Index | Old Index