From c357126cc15e329831624ab110f0bfce3eae9ec7 Mon Sep 17 00:00:00 2001 From: EDiasAlberto Date: Wed, 23 Oct 2024 17:51:48 +0100 Subject: [PATCH] fix missing curly brace --- src/threads/thread.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/threads/thread.c b/src/threads/thread.c index 70d5667..aa9761d 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -372,11 +372,15 @@ thread_yield (void) if (cur != idle_thread) { if (thread_mlfqs) + { list_insert_ordered (&ready_list, &cur->elem, thread_priority_less, NULL); + } else + { /* Insert the thread back into the ready list in priority order. */ list_insert_ordered(&ready_list, &cur->elem, priority_more, NULL); + } } cur->status = THREAD_READY; @@ -473,7 +477,7 @@ thread_update_recent_cpu (struct thread *t, void *aux UNUSED) = fp_add_int (fp_mul (recent_cpu_coeff, curr_recent_cpu), t->nice); // recent_cpu was updated, update priority. t->priority = calculate_bsd_priority (t->recent_cpu, t->nice); - +} /* Recalculates the effective priority of the current thread. */ void thread_recalculate_priority (void)