Update donate_priority to only attempt to sort position of the donee that isn't waiting for a lock
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user