[kernel] Keep other threads out of idle priority

Split out different constants for scheduler::idle_priority and
scheduler::max_priority, so that threads never fall to the same priority
level as the idle threads.
This commit is contained in:
Justin C. Miller
2023-02-18 14:17:57 -08:00
parent e250aaef30
commit 8817766469
5 changed files with 10 additions and 9 deletions

View File

@@ -171,9 +171,9 @@ thread::setup_kernel_stack()
}
thread *
thread::create_idle_thread(process &kernel, uint8_t pri, uintptr_t rsp0)
thread::create_idle_thread(process &kernel, uintptr_t rsp0)
{
thread *idle = new thread(kernel, pri, rsp0);
thread *idle = new thread(kernel, scheduler::idle_priority, rsp0);
idle->set_state(state::constant);
idle->set_state(state::ready);
return idle;

View File

@@ -168,9 +168,8 @@ public:
/// Create the kernel idle thread
/// \arg kernel The process object that owns kernel tasks
/// \arg pri The idle thread priority value
/// \arg rsp The existing stack for the idle thread
static thread * create_idle_thread(process &kernel, uint8_t pri, uintptr_t rsp);
static thread * create_idle_thread(process &kernel, uintptr_t rsp);
protected:
/// Don't delete a thread on no handles, the scheduler takes