Refactor lock release to follow PintOS indent style and use list functoins, w/ T
This commit is contained in:
@@ -318,15 +318,8 @@ lock_release (struct lock *lock)
|
|||||||
released, transfer the remaining orphaned donors to its donor list. */
|
released, transfer the remaining orphaned donors to its donor list. */
|
||||||
if (max_donor != NULL)
|
if (max_donor != NULL)
|
||||||
{
|
{
|
||||||
tail = list_tail (&orphan_list);
|
while (!list_empty (&orphan_list))
|
||||||
e = list_begin (&orphan_list);
|
list_push_back (&max_donor->donors_list, list_pop_front (&orphan_list));
|
||||||
while (e != tail)
|
|
||||||
{
|
|
||||||
struct list_elem *next = list_next (e);
|
|
||||||
list_push_back (&max_donor->donors_list, e);
|
|
||||||
|
|
||||||
e = next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Removal of donors to this thread may change its effective priority,
|
/* Removal of donors to this thread may change its effective priority,
|
||||||
|
|||||||
Reference in New Issue
Block a user