Nucleus
Barry Preemptive and lockless scheduler a1eaf26 (3 years, 1 month ago)diff --git a/task/time.c b/task/time.c index 654795c..d4d01f0 100644 --- a/task/time.c +++ b/task/time.c @@ -25,10 +25,7 @@ timer_handler(struct InterruptFrame *frame) Scheduler *s = cpu->scheduler; if (monotonic % 300000 == 0) balance_scheduler(); - s->timeslice++; - - /* Call scheduler */ - if (s->timeslice < (current->priority * 10)) - return; - schedule(); + if (s->timeslice == 0) + schedule(); + s->timeslice--; }