mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-22 16:44:32 +01:00
Add some kasserts
This commit is contained in:
parent
077c971c86
commit
b2578c6c06
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135181
@ -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) ||
|
||||
|
@ -794,6 +794,8 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
|
||||
* added to the run queue and selected.
|
||||
*/
|
||||
if (newtd) {
|
||||
KASSERT((newtd->td_inhibitors == 0),
|
||||
("trying to run inhibitted thread"));
|
||||
newtd->td_ksegrp->kg_avail_opennings--;
|
||||
newtd->td_kse->ke_flags |= KEF_DIDRUN;
|
||||
TD_SET_RUNNING(newtd);
|
||||
|
Loading…
Reference in New Issue
Block a user