summaryrefslogtreecommitdiff
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2005-06-17 22:33:35 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2005-06-17 22:33:35 +0000
commitaa63bd8662fe09c801819e31bcb985a531c0d138 (patch)
tree316c2464c2c119e142f95b02578aeb388dcfbd56 /sys/kern/kern_synch.c
parent09892ee6b78b0ff3237745cfa83eafe8362e925e (diff)
A second approach at fixing the telnet localhost & problem
(but I tend to call it ssh localhost & now when telnetd is history). This is more localized patch, but leaves us with a recursive lock for protecting scheduling and signal state. Better care is taken to actually be symmetric over mi_switch. Also, the dolock cruft in psignal can go with this solution. Better test runs by more people for longer time has been carried out compared to the c2k5 patch. Long term the current mess with interruptible sleep, the default action on stop signals and wakeup interactions need to be revisited. ok deraadt@, art@
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 16fc2d6f8ae..3f6232c282f 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.63 2005/05/29 03:20:41 deraadt Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.64 2005/06/17 22:33:34 niklas Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*-
@@ -174,12 +174,10 @@ ltsleep(ident, priority, wmesg, timo, interlock)
if (p->p_wchan)
unsleep(p);
p->p_stat = SONPROC;
- SCHED_UNLOCK(s);
goto resume;
}
if (p->p_wchan == 0) {
catch = 0;
- SCHED_UNLOCK(s);
goto resume;
}
} else
@@ -193,14 +191,9 @@ ltsleep(ident, priority, wmesg, timo, interlock)
__asm(".globl bpendtsleep\nbpendtsleep:");
#endif
- SCHED_ASSERT_UNLOCKED();
- /*
- * Note! this splx belongs to the SCHED_LOCK(s) above, mi_switch
- * releases the scheduler lock, but does not lower the spl.
- */
- splx(s);
-
resume:
+ SCHED_UNLOCK(s);
+
#ifdef __HAVE_CPUINFO
p->p_cpu->ci_schedstate.spc_curpriority = p->p_usrpri;
#else