Source-Changes-HG archive

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

[src/netbsd-2]: src/sys/kern Pull up following revision(s) (requested by yamt...



details:   https://anonhg.NetBSD.org/src/rev/02842e249249
branches:  netbsd-2
changeset: 564002:02842e249249
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Aug 24 03:57:26 2005 +0000

description:
Pull up following revision(s) (requested by yamt in ticket #5609):
        sys/kern/kern_exit.c: revision 1.149
exit_lwps: fix a race which causes a panic "setrunnable: lwp %p state was %d".

diffstat:

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

diffs (35 lines):

diff -r 27d968b23ce3 -r 02842e249249 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Wed Aug 24 03:56:30 2005 +0000
+++ b/sys/kern/kern_exit.c      Wed Aug 24 03:57:26 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.139 2004/03/14 01:08:47 cl Exp $       */
+/*     $NetBSD: kern_exit.c,v 1.139.4.1 2005/08/24 03:57:26 riz Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.139 2004/03/14 01:08:47 cl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.139.4.1 2005/08/24 03:57:26 riz Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -578,14 +578,14 @@
        LIST_FOREACH(l2, &p->p_lwps, l_sibling) {
                l2->l_flag &= ~(L_DETACHED|L_SA);
 
+               SCHED_LOCK(s);
                if ((l2->l_stat == LSSLEEP && (l2->l_flag & L_SINTR)) ||
                    l2->l_stat == LSSUSPENDED || l2->l_stat == LSSTOP) {
-                       SCHED_LOCK(s);
                        setrunnable(l2);
-                       SCHED_UNLOCK(s);
                        DPRINTF(("exit_lwps: Made %d.%d runnable\n",
                            p->p_pid, l2->l_lid));
                }
+               SCHED_UNLOCK(s);
        }
 
        



Home | Main Index | Thread Index | Old Index