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)
This commit is contained in:
Julian Elischer 2003-05-21 18:53:25 +00:00
parent 67fd2837cd
commit faaa20f639

View File

@ -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);