Update set_priority to ensure that the new priority is within bounds
This commit is contained in:
@@ -374,6 +374,9 @@ priority_more (const struct list_elem *a_, const struct list_elem *b_,
|
|||||||
void
|
void
|
||||||
thread_set_priority (int new_priority)
|
thread_set_priority (int new_priority)
|
||||||
{
|
{
|
||||||
|
ASSERT (new_priority >= PRI_MIN);
|
||||||
|
ASSERT (new_priority <= PRI_MAX);
|
||||||
|
|
||||||
thread_current ()->priority = new_priority;
|
thread_current ()->priority = new_priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user