From faaa20f6397d1d8023add8019b3136062dc3ec5e Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Wed, 21 May 2003 18:53:25 +0000 Subject: [PATCH] When we are spilling threads out of the run queue during panic, make sure we keep the thread state variable consistent with its real state. i.e. Don't say it's on the run queue when it isn't. Also clarify the associated comment. Turns a double panic back to a single panic :-/ Approved by: re@ (jhb) --- sys/kern/kern_switch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 377ad429ff45..873e8d27d405 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -162,12 +162,15 @@ choosethread(void) ke->ke_flags |= KEF_DIDRUN; /* - * Only allow non system threads to run in panic - * if they are the one we are tracing. (I think.. [JRE]) + * If we are in panic, only allow system threads, + * plus the one we are running in, to be run. */ if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 && - (td->td_flags & TDF_INPANIC) == 0)) + (td->td_flags & TDF_INPANIC) == 0)) { + /* note that it is no longer on the run queue */ + TD_SET_CAN_RUN(td); goto retry; + } TD_SET_RUNNING(td); return (td);