Split Yield and Preempt into separate scheduling functions.

This switch makes the logic for each much easier to parse.
This commit is contained in:
Drew Galbraith 2023-05-29 23:09:39 -07:00
parent 3fee5ac9d7
commit b58186265e
3 changed files with 54 additions and 31 deletions

View file

@ -12,6 +12,13 @@ void InitScheduler();
// Enables the scheduler such that processes will yield on ticks.
void EnableScheduler();
// Preempts the current thread and flags it as runnable in the queue.
// Generally used by the timer to move to the next timeslice.
void Preempt();
// Current thread yields and is not rescheduled until some external process
// adds it.
// Used when a thread blocks or exits.
void Yield();
// Scheduler will take ownership