Update thread_set_priority to not do anything if priority is unchanged
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user