MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tdq_add

Function tdq_add

freebsd/kern/sched_ule.c:2547–2564  ·  view source on GitHub ↗

* Add a thread to a thread queue. Select the appropriate runq and add the * thread to it. This is the internal function called when the tdq is * predetermined. */

Source from the content-addressed store, hash-verified

2545 * predetermined.
2546 */
2547void
2548tdq_add(struct tdq *tdq, struct thread *td, int flags)
2549{
2550
2551 TDQ_LOCK_ASSERT(tdq, MA_OWNED);
2552 THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED);
2553 KASSERT((td->td_inhibitors == 0),
2554 ("sched_add: trying to run inhibited thread"));
2555 KASSERT((TD_CAN_RUN(td) || TD_IS_RUNNING(td)),
2556 ("sched_add: bad thread state"));
2557 KASSERT(td->td_flags & TDF_INMEM,
2558 ("sched_add: thread swapped out"));
2559
2560 if (td->td_priority < tdq->tdq_lowpri)
2561 tdq->tdq_lowpri = td->td_priority;
2562 tdq_runq_add(tdq, td, flags);
2563 tdq_load_add(tdq, td);
2564}
2565
2566/*
2567 * Select the target thread queue and add a thread to it. Request

Callers 3

tdq_moveFunction · 0.85
sched_switch_migrateFunction · 0.85
sched_addFunction · 0.85

Calls 2

tdq_runq_addFunction · 0.85
tdq_load_addFunction · 0.85

Tested by

no test coverage detected