thread: move thread awaken functionality to a dedicated function
This commit is contained in:
@@ -127,6 +127,17 @@ int thread_priority(struct thread *thr)
|
||||
return thr->tr_prio;
|
||||
}
|
||||
|
||||
void thread_awaken(struct thread *thr)
|
||||
{
|
||||
struct runqueue *rq = thr->tr_rq;
|
||||
if (!rq) {
|
||||
rq = cpu_rq(this_cpu());
|
||||
}
|
||||
|
||||
thr->tr_state = THREAD_READY;
|
||||
rq_enqueue(rq, thr);
|
||||
}
|
||||
|
||||
struct thread *create_kernel_thread(void (*fn)(void))
|
||||
{
|
||||
struct task *kernel = kernel_task();
|
||||
|
||||
Reference in New Issue
Block a user