From bfdedc53e263fc0b80b86c587bad053f5c5cd38c Mon Sep 17 00:00:00 2001 From: sBubshait Date: Thu, 17 Oct 2024 19:46:10 +0100 Subject: [PATCH] Update set priority so not to yield if no ready threads --- src/threads/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threads/thread.c b/src/threads/thread.c index e587626..3e5d15c 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -383,7 +383,7 @@ thread_set_priority (int new_priority) thread_current ()->priority = new_priority; - if (new_priority < old_priority) + if (new_priority < old_priority && !list_empty (&ready_list)) thread_yield (); }