mirror of
https://github.com/RGBCube/serenity
synced 2025-07-16 14:47:37 +00:00
Kernel: Remove unused bool return values from scheduler functions
Turns out nobody actually cared whether the scheduler switched to a new thread or not (which is what we were returning.)
This commit is contained in:
parent
a6b5065d94
commit
cffcfca80a
2 changed files with 10 additions and 17 deletions
|
@ -205,7 +205,7 @@ UNMAP_AFTER_INIT void Scheduler::start()
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scheduler::pick_next()
|
void Scheduler::pick_next()
|
||||||
{
|
{
|
||||||
VERIFY_INTERRUPTS_DISABLED();
|
VERIFY_INTERRUPTS_DISABLED();
|
||||||
|
|
||||||
|
@ -241,10 +241,10 @@ bool Scheduler::pick_next()
|
||||||
critical.leave();
|
critical.leave();
|
||||||
|
|
||||||
thread_to_schedule.set_ticks_left(time_slice_for(thread_to_schedule));
|
thread_to_schedule.set_ticks_left(time_slice_for(thread_to_schedule));
|
||||||
return context_switch(&thread_to_schedule);
|
context_switch(&thread_to_schedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scheduler::yield()
|
void Scheduler::yield()
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
|
|
||||||
|
@ -256,18 +256,13 @@ bool Scheduler::yield()
|
||||||
// a critical section where we don't want to switch contexts, then
|
// a critical section where we don't want to switch contexts, then
|
||||||
// delay until exiting the trap or critical section
|
// delay until exiting the trap or critical section
|
||||||
Processor::current().invoke_scheduler_async();
|
Processor::current().invoke_scheduler_async();
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Scheduler::pick_next())
|
Scheduler::pick_next();
|
||||||
return false;
|
|
||||||
|
|
||||||
if constexpr (SCHEDULER_DEBUG)
|
|
||||||
dbgln("Scheduler[{}]: yield returns to thread {} in_irq={}", Processor::current_id(), *current_thread, Processor::current_in_irq());
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scheduler::context_switch(Thread* thread)
|
void Scheduler::context_switch(Thread* thread)
|
||||||
{
|
{
|
||||||
if (Memory::s_mm_lock.is_locked_by_current_processor()) {
|
if (Memory::s_mm_lock.is_locked_by_current_processor()) {
|
||||||
PANIC("In context switch while holding Memory::s_mm_lock");
|
PANIC("In context switch while holding Memory::s_mm_lock");
|
||||||
|
@ -279,7 +274,7 @@ bool Scheduler::context_switch(Thread* thread)
|
||||||
VERIFY(from_thread);
|
VERIFY(from_thread);
|
||||||
|
|
||||||
if (from_thread == thread)
|
if (from_thread == thread)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
// If the last process hasn't blocked (still marked as running),
|
// If the last process hasn't blocked (still marked as running),
|
||||||
// mark it as runnable for the next round.
|
// mark it as runnable for the next round.
|
||||||
|
@ -309,8 +304,6 @@ bool Scheduler::context_switch(Thread* thread)
|
||||||
// switched from, and thread reflects Thread::current()
|
// switched from, and thread reflects Thread::current()
|
||||||
enter_current(*from_thread);
|
enter_current(*from_thread);
|
||||||
VERIFY(thread == Thread::current());
|
VERIFY(thread == Thread::current());
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scheduler::enter_current(Thread& prev_thread)
|
void Scheduler::enter_current(Thread& prev_thread)
|
||||||
|
|
|
@ -36,9 +36,9 @@ public:
|
||||||
static void set_idle_thread(Thread* idle_thread);
|
static void set_idle_thread(Thread* idle_thread);
|
||||||
static void timer_tick(const RegisterState&);
|
static void timer_tick(const RegisterState&);
|
||||||
[[noreturn]] static void start();
|
[[noreturn]] static void start();
|
||||||
static bool pick_next();
|
static void pick_next();
|
||||||
static bool yield();
|
static void yield();
|
||||||
static bool context_switch(Thread*);
|
static void context_switch(Thread*);
|
||||||
static void enter_current(Thread& prev_thread);
|
static void enter_current(Thread& prev_thread);
|
||||||
static void leave_on_first_switch(u32 flags);
|
static void leave_on_first_switch(u32 flags);
|
||||||
static void prepare_after_exec();
|
static void prepare_after_exec();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue