Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Adapt to the new conventions of proc_unstop() and d...



details:   https://anonhg.NetBSD.org/src/rev/eb1deb4b3081
branches:  trunk
changeset: 542805:eb1deb4b3081
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Fri Feb 07 21:44:45 2003 +0000

description:
Adapt to the new conventions of proc_unstop() and don't try to call
setrunnable(NULL).

diffstat:

 sys/kern/sys_process.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 8b369bb8e047 -r eb1deb4b3081 sys/kern/sys_process.c
--- a/sys/kern/sys_process.c    Fri Feb 07 21:43:18 2003 +0000
+++ b/sys/kern/sys_process.c    Fri Feb 07 21:44:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_process.c,v 1.79 2003/01/23 17:35:32 christos Exp $        */
+/*     $NetBSD: sys_process.c,v 1.80 2003/02/07 21:44:45 nathanw Exp $ */
 
 /*-
  * Copyright (c) 1993 Jan-Simon Pendry.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.79 2003/01/23 17:35:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.80 2003/02/07 21:44:45 nathanw Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -97,7 +97,7 @@
                syscallarg(int) data;
        } */ *uap = v;
        struct proc *p = l->l_proc;
-       struct lwp *lt;
+       struct lwp *lt, *lr;
        struct proc *t;                         /* target process */
        struct uio uio;
        struct iovec iov;
@@ -380,7 +380,15 @@
                if (t->p_stat == SSTOP) {
                        t->p_xstat = SCARG(uap, data);
                        SCHED_LOCK(s);
-                       setrunnable(proc_unstop(t));
+                       lr = proc_unstop(t);
+                       /*
+                        * If the target needs to take a signal, there
+                        * is no running LWP that will see it, and
+                        * there is a LWP sleeping interruptably, then
+                        * get it moving.
+                        */
+                       if (lr && (t->p_xstat != 0))
+                           setrunnable(lr);
                        SCHED_UNLOCK(s);
                } else {
                        if (SCARG(uap, data) != 0)



Home | Main Index | Thread Index | Old Index