* Add the thread to the queue specified by its priority, and set the * corresponding status bit. */
| 366 | * corresponding status bit. |
| 367 | */ |
| 368 | void |
| 369 | runq_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 | |
| 387 | void |
| 388 | runq_add_pri(struct runq *rq, struct thread *td, u_char pri, int flags) |
no test coverage detected