| 156 | */ |
| 157 | |
| 158 | static __noinline struct thread * |
| 159 | choosethread_panic(struct thread *td) |
| 160 | { |
| 161 | |
| 162 | /* |
| 163 | * If we are in panic, only allow system threads, |
| 164 | * plus the one we are running in, to be run. |
| 165 | */ |
| 166 | retry: |
| 167 | if (((td->td_proc->p_flag & P_SYSTEM) == 0 && |
| 168 | (td->td_flags & TDF_INPANIC) == 0)) { |
| 169 | /* note that it is no longer on the run queue */ |
| 170 | TD_SET_CAN_RUN(td); |
| 171 | td = sched_choose(); |
| 172 | goto retry; |
| 173 | } |
| 174 | |
| 175 | TD_SET_RUNNING(td); |
| 176 | return (td); |
| 177 | } |
| 178 | |
| 179 | struct thread * |
| 180 | choosethread(void) |
no test coverage detected