summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r--sys/kern/kern_switch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c
index 9841f2a..b937f8a 100644
--- a/sys/kern/kern_switch.c
+++ b/sys/kern/kern_switch.c
@@ -331,6 +331,8 @@ setrunqueue(struct thread *td, int flags)
CTR3(KTR_RUNQ, "setrunqueue: td:%p kg:%p pid:%d",
td, td->td_ksegrp, td->td_proc->p_pid);
mtx_assert(&sched_lock, MA_OWNED);
+ KASSERT((td->td_inhibitors == 0),
+ ("setrunqueue: trying to run inhibitted thread"));
KASSERT((TD_CAN_RUN(td) || TD_IS_RUNNING(td)),
("setrunqueue: bad thread state"));
TD_SET_RUNQ(td);
@@ -504,6 +506,8 @@ maybe_preempt(struct thread *td)
ctd = curthread;
KASSERT ((ctd->td_kse != NULL && ctd->td_kse->ke_thread == ctd),
("thread has no (or wrong) sched-private part."));
+ KASSERT((td->td_inhibitors == 0),
+ ("maybe_preempt: trying to run inhibitted thread"));
pri = td->td_priority;
cpri = ctd->td_priority;
if (pri >= cpri || cold /* || dumping */ || TD_IS_INHIBITED(ctd) ||
OpenPOWER on IntegriCloud