| 385 | } |
| 386 | |
| 387 | void |
| 388 | runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags) |
| 389 | { |
| 390 | struct rqhead *rqh; |
| 391 | |
| 392 | KASSERT(pri < RQ_NQS, ("runq_add_pri: %d out of range", pri)); |
| 393 | td->td_rqindex = pri; |
| 394 | runq_setbit(rq, pri); |
| 395 | rqh = &rq->rq_queues[pri]; |
| 396 | CTR4(KTR_RUNQ, "runq_add_pri: td=%p pri=%d idx=%d rqh=%p", |
| 397 | td, td->td_priority, pri, rqh); |
| 398 | if (flags & SRQ_PREEMPTED) { |
| 399 | TAILQ_INSERT_HEAD(rqh, td, td_runq); |
| 400 | } else { |
| 401 | TAILQ_INSERT_TAIL(rqh, td, td_runq); |
| 402 | } |
| 403 | } |
| 404 | /* |
| 405 | * Return true if there are runnable processes of any priority on the run |
| 406 | * queue, false otherwise. Has no side effects, does not modify the run |
no test coverage detected