Update donate_priority to only attempt to sort position of the donee that isn't waiting for a lock

This commit is contained in:
Themis Demetriades
2024-10-23 13:29:45 +01:00
parent d82176a2e2
commit a875d5fcb4
3 changed files with 24 additions and 7 deletions

View File

@@ -214,12 +214,17 @@ donate_priority (struct thread *donor, struct thread *donee) {
/* 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)
donee = 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. */
ready_list_reinsert (donee);
donee = NULL;
}
else
donee = donee->waiting_lock->holder;
}
ready_list_reorder ();
}
/* Acquires LOCK, sleeping until it becomes available if