Update set_priority to ensure that the new priority is within bounds

This commit is contained in:
sBubshait
2024-10-16 07:58:35 +01:00
parent 9bb0b758c8
commit 1c53790ca7

View File

@@ -374,6 +374,9 @@ priority_more (const struct list_elem *a_, const struct list_elem *b_,
void
thread_set_priority (int new_priority)
{
ASSERT (new_priority >= PRI_MIN);
ASSERT (new_priority <= PRI_MAX);
thread_current ()->priority = new_priority;
}