From 4066354f8afa0409ec6d7e2800d403093120ef24 Mon Sep 17 00:00:00 2001 From: Themis Demetriades Date: Fri, 25 Oct 2024 17:03:18 +0100 Subject: [PATCH] Refactor thread_create () to call thread_get_priority in order to retrieve priority --- 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 d488677..7102ad2 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -264,7 +264,7 @@ thread_create (const char *name, int priority, /* Yield if the newly created thread has higher priority than the current thread. */ - if (t->priority > thread_current ()->priority) + if (t->priority > thread_get_priority ()) thread_yield (); return tid;