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
4 changed files with 69 additions and 3 deletions
Showing only changes of commit 24900545d4 - Show all commits

View File

@@ -68,7 +68,8 @@ sema_down (struct semaphore *sema)
old_level = intr_disable (); old_level = intr_disable ();
while (sema->value == 0) while (sema->value == 0)
{ {
list_push_back (&sema->waiters, &thread_current ()->elem); list_insert_ordered(&sema->waiters, &thread_current ()->elem,
priority_more, NULL);
thread_block (); thread_block ();
} }
sema->value--; sema->value--;