Merge 'task1/priority-donation' into 'master' #14

Merged
sb3923 merged 66 commits from task1/priority-donation into master 2024-10-23 16:15:45 +00:00
2 changed files with 38 additions and 2 deletions
Showing only changes of commit 62c8818c05 - Show all commits

View File

@@ -336,8 +336,11 @@ thread_yield (void)
ASSERT (!intr_context ()); ASSERT (!intr_context ());
old_level = intr_disable (); old_level = intr_disable ();
/* Insert the thread back into the ready list in priority order. */
if (cur != idle_thread) if (cur != idle_thread)
list_push_back (&ready_list, &cur->elem); list_insert_ordered(&ready_list, &cur->elem, priority_more, NULL);
cur->status = THREAD_READY; cur->status = THREAD_READY;
schedule (); schedule ();
intr_set_level (old_level); intr_set_level (old_level);