diff --git a/src/threads/thread.c b/src/threads/thread.c index e34d23e..f681f92 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -383,6 +383,10 @@ thread_set_priority (int new_priority) ASSERT (new_priority >= PRI_MIN); ASSERT (new_priority <= PRI_MAX); + int old_priority = thread_get_priority (); + if (new_priority == old_priority) + return; + thread_current ()->priority = new_priority; }