sched: add support for scheduling functions to be executed later
This commit is contained in:
@@ -61,3 +61,22 @@ struct runqueue *cpu_rq(unsigned int cpu)
|
||||
|
||||
return rq;
|
||||
}
|
||||
|
||||
void rq_remove_thread(struct runqueue *rq, struct thread *thr)
|
||||
{
|
||||
int prio = thread_priority(thr);
|
||||
if (prio < 0 || prio > PRIO_MAX) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct queue *q = &rq->rq_queues[prio];
|
||||
queue_delete(q, &thr->tr_rqentry);
|
||||
|
||||
if (rq->rq_nthreads > 0) {
|
||||
rq->rq_nthreads--;
|
||||
}
|
||||
|
||||
if (queue_empty(q)) {
|
||||
rq->rq_readybits &= ~PRIO_MASK(prio);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user