Merge task1/themis/priority-donation into task1/priority-donation #13

Merged
td1223 merged 4 commits from task1/themis/priority-donation into task1/priority-donation 2024-10-23 15:03:08 +00:00
3 changed files with 33 additions and 13 deletions
Showing only changes of commit 5f8dea21be - Show all commits

View File

@@ -210,23 +210,25 @@ donate_priority (struct thread *donee) {
if (donor->priority <= donee->priority)
break;
donee->priority = donor->priority;
/* Also stop propagation of donation once a donee is reached with
no donees of its own (sink node in WFG). */
if (donee->waiting_lock == NULL)
{
/* Only the sink node of the WFG isn't waiting for a lock and
could be on the ready list. Thus, as its priority changed,
it must be reinserted into the list. */
enum intr_level old_level = intr_disable ();
donee->priority = donor->priority;
ready_list_reinsert (donee);
intr_set_level (old_level);
donee = NULL;
}
else
donee = donee->waiting_lock->holder;
{
donee->priority = donor->priority;
donee = donee->waiting_lock->holder;
}
}
}