Source-Changes-HG archive

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

[src/trunk]: src/sys/kern ltsleep(): deal with PNOEXITERR after re-taking the...



details:   https://anonhg.NetBSD.org/src/rev/3c24e69c9f6f
branches:  trunk
changeset: 542709:3c24e69c9f6f
user:      pk <pk%NetBSD.org@localhost>
date:      Tue Feb 04 20:15:59 2003 +0000

description:
ltsleep(): deal with PNOEXITERR after re-taking the interlock (if necessary).

diffstat:

 sys/kern/kern_synch.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (46 lines):

diff -r b6905932710b -r 3c24e69c9f6f sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Tue Feb 04 20:14:10 2003 +0000
+++ b/sys/kern/kern_synch.c     Tue Feb 04 20:15:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.125 2003/02/04 13:41:50 yamt Exp $    */
+/*     $NetBSD: kern_synch.c,v 1.126 2003/02/04 20:15:59 pk Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.125 2003/02/04 13:41:50 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.126 2003/02/04 20:15:59 pk Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -536,6 +536,14 @@
                        return (EINTR);
                return (ERESTART);
        }
+
+#ifdef KTRACE
+       if (KTRPOINT(p, KTR_CSW))
+               ktrcsw(p, 0, 0);
+#endif
+       if (relock && interlock != NULL)
+               simple_lock(interlock);
+
        /* XXXNJW this is very much a kluge.
         * revisit. a better way of preventing looping/hanging syscalls like 
         * wait4() and _lwp_wait() from wedging an exiting process
@@ -543,12 +551,6 @@
         */
        if (catch && ((p->p_flag & P_WEXIT) && exiterr))
                return (EINTR);
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_CSW))
-               ktrcsw(p, 0, 0);
-#endif
-       if (relock && interlock != NULL)
-               simple_lock(interlock);
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index