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 18 additions and 2 deletions
Showing only changes of commit 79061fcb9b - Show all commits

View File

@@ -256,7 +256,7 @@ thread_unblock (struct thread *t)
old_level = intr_disable ();
ASSERT (t->status == THREAD_BLOCKED);
list_push_back (&ready_list, &t->elem);
list_insert_ordered (&ready_list, &t->elem, &thread_priority_greater, NULL);
t->status = THREAD_READY;
intr_set_level (old_level);
}
@@ -327,7 +327,8 @@ thread_yield (void)
old_level = intr_disable ();
if (cur != idle_thread)
list_push_back (&ready_list, &cur->elem);
list_insert_ordered (&ready_list, &cur->elem, thread_priority_greater,
NULL);
cur->status = THREAD_READY;
schedule ();
intr_set_level (old_level);