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

Function runq_choose_from

freebsd/kern/kern_switch.c:492–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492struct thread *
493runq_choose_from(struct runq *rq, u_char idx)
494{
495 struct rqhead *rqh;
496 struct thread *td;
497 int pri;
498
499 if ((pri = runq_findbit_from(rq, idx)) != -1) {
500 rqh = &rq->rq_queues[pri];
501 td = TAILQ_FIRST(rqh);
502 KASSERT(td != NULL, ("runq_choose: no thread on busy queue"));
503 CTR4(KTR_RUNQ,
504 "runq_choose_from: pri=%d thread=%p idx=%d rqh=%p",
505 pri, td, td->td_rqindex, rqh);
506 return (td);
507 }
508 CTR1(KTR_RUNQ, "runq_choose_from: idlethread pri=%d", pri);
509
510 return (NULL);
511}
512/*
513 * Remove the thread from the queue specified by its priority, and clear the
514 * corresponding status bit if the queue becomes empty.

Callers 1

tdq_chooseFunction · 0.85

Calls 1

runq_findbit_fromFunction · 0.85

Tested by

no test coverage detected