Kernel: Scheduler now has reschedule()
This can be called from anywhere and just causes the scheduler to schedule the next thread. This is more efficient and verbose version of Scheduler::set_current_thread_sleeping(0), since we don't have to wake other threads or do other verifications.
This commit is contained in:
@@ -84,6 +84,21 @@ namespace Kernel
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Scheduler::reschedule()
|
||||
{
|
||||
VERIFY_STI();
|
||||
DISABLE_INTERRUPTS();
|
||||
|
||||
if (save_current_thread())
|
||||
{
|
||||
ENABLE_INTERRUPTS();
|
||||
return;
|
||||
}
|
||||
advance_current_thread();
|
||||
execute_current_thread();
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Scheduler::reschedule_if_idling()
|
||||
{
|
||||
VERIFY_CLI();
|
||||
|
||||
Reference in New Issue
Block a user