Source-Changes-HG archive

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

[src/trunk]: src/sys Make the wakeup optionnal in proc_stop, so that it is po...



details:   https://anonhg.NetBSD.org/src/rev/b7d84d06453f
branches:  trunk
changeset: 555779:b7d84d06453f
user:      manu <manu%NetBSD.org@localhost>
date:      Thu Nov 27 23:16:47 2003 +0000

description:
Make the wakeup optionnal in proc_stop, so that it is possible to stop a
process without waking up its parent.

diffstat:

 sys/kern/kern_sig.c |  15 ++++++++-------
 sys/sys/proc.h      |   4 ++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (82 lines):

diff -r c57b7e1e489a -r b7d84d06453f sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Thu Nov 27 23:02:40 2003 +0000
+++ b/sys/kern/kern_sig.c       Thu Nov 27 23:16:47 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.179 2003/11/17 19:21:56 christos Exp $  */
+/*     $NetBSD: kern_sig.c,v 1.180 2003/11/27 23:16:47 manu Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.179 2003/11/17 19:21:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.180 2003/11/27 23:16:47 manu Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_compat_sunos.h"
@@ -1198,7 +1198,7 @@
                                 */
                                child_psignal(p, 0);
                        }
-                       proc_stop(p);   /* XXXSMP: recurse? */
+                       proc_stop(p, 1);        /* XXXSMP: recurse? */
                        goto done;
                }
 
@@ -1453,7 +1453,7 @@
                                child_psignal(p, dolock);
                        if (dolock)
                                SCHED_LOCK(s);
-                       proc_stop(p);
+                       proc_stop(p, 1);
                sigtraceswitch:
                        mi_switch(l, NULL);
                        SCHED_ASSERT_UNLOCKED();
@@ -1526,7 +1526,7 @@
                                        child_psignal(p, dolock);
                                if (dolock)
                                        SCHED_LOCK(s);
-                               proc_stop(p);
+                               proc_stop(p, 1);
                        sigswitch:
                                mi_switch(l, NULL);
                                SCHED_ASSERT_UNLOCKED();
@@ -1583,7 +1583,7 @@
  * on the run queue.
  */
 void
-proc_stop(struct proc *p)
+proc_stop(struct proc *p, int wakeup)
 {
        struct lwp *l;
        struct proc *parent;
@@ -1674,7 +1674,8 @@
  out:
        /* XXX unlock process LWP state */
 
-       sched_wakeup((caddr_t)p->p_pptr);
+       if (wakeup)
+               sched_wakeup((caddr_t)p->p_pptr);
 }
 
 /*
diff -r c57b7e1e489a -r b7d84d06453f sys/sys/proc.h
--- a/sys/sys/proc.h    Thu Nov 27 23:02:40 2003 +0000
+++ b/sys/sys/proc.h    Thu Nov 27 23:16:47 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.177 2003/11/17 19:21:24 christos Exp $      */
+/*     $NetBSD: proc.h,v 1.178 2003/11/27 23:16:47 manu Exp $  */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -478,7 +478,7 @@
 void   child_return(void *);
 
 int    proc_isunder(struct proc *, struct proc *);
-void   proc_stop(struct proc *);
+void   proc_stop(struct proc *, int);
 
 void   proclist_lock_read(void);
 void   proclist_unlock_read(void);



Home | Main Index | Thread Index | Old Index