| 490 | } |
| 491 | |
| 492 | struct thread * |
| 493 | runq_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. |
no test coverage detected