From 3c1a26b668c38b8a205194f2c52d47b57e7d9f5a Mon Sep 17 00:00:00 2001 From: Themis Demetriades Date: Tue, 15 Oct 2024 15:14:05 +0100 Subject: [PATCH] Update setting of thread priorities to yield in case a higher priority thread requires control --- src/threads/thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/threads/thread.c b/src/threads/thread.c index 6b48788..6c1dcca 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -358,6 +358,7 @@ thread_set_priority (int new_priority) { ASSERT (PRI_MIN <= new_priority && new_priority <= PRI_MAX); thread_current ()->priority = new_priority; + thread_yield (); } /* Returns the current thread's priority. */