Update thread_set_priority to not do anything if priority is unchanged

This commit is contained in:
sBubshait
2024-10-17 06:00:34 +01:00
parent 62c8818c05
commit 9f53040d27

View File

@@ -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;
}