Update set priority so not to yield if no ready threads
This commit is contained in:
@@ -383,7 +383,7 @@ thread_set_priority (int new_priority)
|
|||||||
|
|
||||||
thread_current ()->priority = new_priority;
|
thread_current ()->priority = new_priority;
|
||||||
|
|
||||||
if (new_priority < old_priority)
|
if (new_priority < old_priority && !list_empty (&ready_list))
|
||||||
thread_yield ();
|
thread_yield ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user