BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / a1eaf264431107a223a69ca35d3b916243d7b90e / task / time.c

// Related

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--;
 }