From b336a56514b18fa6a85b32c7b2036771e3362d77 Mon Sep 17 00:00:00 2001 From: scottl Date: Fri, 20 Aug 2004 05:18:50 +0000 Subject: In maybe_preempt(), ignore threads that are in an inconsistent state. This is an effective band-aid for at least some of the scheduler corruption seen recently. The real fix will involve protecting threads while they are inconsistent, and will come later. Submitted by: julian --- sys/kern/kern_switch.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/kern') diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 92e229e..f2aa3e0 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -522,6 +522,10 @@ maybe_preempt(struct thread *td) * to the new thread. */ ctd = curthread; + + if ((ctd->td_kse == NULL) || (ctd->td_kse->ke_thread != ctd)) + return (0); + pri = td->td_priority; cpri = ctd->td_priority; if (pri >= cpri || cold /* || dumping */ || TD_IS_INHIBITED(ctd) || -- cgit v1.1