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

Function runq_add

freebsd/kern/kern_switch.c:368–385  ·  view source on GitHub ↗

* Add the thread to the queue specified by its priority, and set the * corresponding status bit. */

Source from the content-addressed store, hash-verified

366 * corresponding status bit.
367 */
368void
369runq_add(struct runq *rq, struct thread *td, int flags)
370{
371 struct rqhead *rqh;
372 int pri;
373
374 pri = td->td_priority / RQ_PPQ;
375 td->td_rqindex = pri;
376 runq_setbit(rq, pri);
377 rqh = &rq->rq_queues[pri];
378 CTR4(KTR_RUNQ, "runq_add: td=%p pri=%d %d rqh=%p",
379 td, td->td_priority, pri, rqh);
380 if (flags & SRQ_PREEMPTED) {
381 TAILQ_INSERT_HEAD(rqh, td, td_runq);
382 } else {
383 TAILQ_INSERT_TAIL(rqh, td, td_runq);
384 }
385}
386
387void
388runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags)

Callers 3

sched_addFunction · 0.85
sched_4bsd.cFile · 0.85
tdq_runq_addFunction · 0.85

Calls 1

runq_setbitFunction · 0.85

Tested by

no test coverage detected