Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys/kern The p->p_nrlwps check makes checking the run s...



details:   https://anonhg.NetBSD.org/src/rev/ba203f40782f
branches:  nathanw_sa
changeset: 505547:ba203f40782f
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Fri Jan 18 20:58:00 2002 +0000

description:
The p->p_nrlwps check makes checking the run state of a specific LWP
redundant at best, and incorrect at worst if curproc is something
other than the process where the signal is being delivered. Remove it
entirely.

Problem pointed out by petrov%netbsd.org@localhost.

diffstat:

 sys/kern/kern_sig.c |  30 ++++++++----------------------
 1 files changed, 8 insertions(+), 22 deletions(-)

diffs (51 lines):

diff -r 8288d58741dd -r ba203f40782f sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Fri Jan 18 06:15:33 2002 +0000
+++ b/sys/kern/kern_sig.c       Fri Jan 18 20:58:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.112.2.10 2002/01/09 02:58:56 nathanw Exp $      */
+/*     $NetBSD: kern_sig.c,v 1.112.2.11 2002/01/18 20:58:00 nathanw Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.112.2.10 2002/01/09 02:58:56 nathanw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.112.2.11 2002/01/18 20:58:00 nathanw Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_compat_sunos.h"
@@ -823,26 +823,12 @@
                SCHED_LOCK(s);
        
        if (p->p_nrlwps > 0) {
-               /* An LWP is running. */
-#ifdef __HAVE_AST_PERPROC
-               if ((curproc->l_stat == LSONPROC) ||
-                   (curproc->l_stat == LSRUN) ||
-                   (curproc->l_stat == LSIDL)) {
-                       /*
-                        * LSONPROC: We're running, notice the signal when
-                        * we return back to userspace.
-                        *
-                        * LSRUN, LSIDL: Notice the signal when we run again
-                        * and return to back to userspace.
-                        */
-#else /* ! __HAVE_AST_PERPROC */
-               if (curproc->l_stat == LSONPROC) { /* XXX SMP */
-                       /*
-                        * We're running; notice the signal.
-                        */
-#endif /* __HAVE_AST_PERPROC */
-                       signotify(p);
-               }
+               /*
+                * At least one LWP is running or on a run queue. 
+                * The signal will be noticed when one of them returns 
+                * to userspace.
+                */
+               signotify(p);
                /* 
                 * The signal will be noticed very soon.
                 */



Home | Main Index | Thread Index | Old Index