From 60873784d2fc895c874546f4f1b22098b01a29e7 Mon Sep 17 00:00:00 2001 From: Enrico Fraccaroli Date: Mon, 19 Dec 2022 11:55:33 +0100 Subject: [PATCH] Fix how we retrieve the first element of the list. --- mentos/src/process/scheduler_algorithm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mentos/src/process/scheduler_algorithm.c b/mentos/src/process/scheduler_algorithm.c index c069e3d..f851704 100644 --- a/mentos/src/process/scheduler_algorithm.c +++ b/mentos/src/process/scheduler_algorithm.c @@ -77,7 +77,7 @@ static inline task_struct *__scheduler_priority(runqueue_t *runqueue, bool_t ski { #ifdef SCHEDULER_PRIORITY // Get the first element of the list. - task_struct *next = list_entry(runqueue->curr, task_struct, run_list); + task_struct *next = list_entry(runqueue->queue.next, struct task_struct, run_list); // Get its static priority. time_t min = /*...*/; @@ -121,7 +121,7 @@ static inline task_struct *__scheduler_cfs(runqueue_t *runqueue, bool_t skip_per { #ifdef SCHEDULER_CFS // Get the first element of the list. - task_struct *next = list_entry(runqueue->curr, task_struct, run_list); + task_struct *next = list_entry(runqueue->queue.next, struct task_struct, run_list); // Get its virtual runtime. time_t min = /* ... */;