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 (); }