Update lock_release to disable interrupts in critical sections w/ S

This commit is contained in:
Themis Demetriades
2024-10-23 16:45:42 +01:00
parent 4879775d0b
commit 95386971e2

View File

@@ -303,6 +303,7 @@ lock_release (struct lock *lock)
struct list orphan_list;
list_init (&orphan_list);
enum intr_level old_level = intr_disable ();
/* Loop through current thread's donors, removing the ones waiting for the
lock being released and keeping track of them (within orphan_list).
Also identifies the highest priority donor thread among them. */
@@ -336,6 +337,7 @@ lock_release (struct lock *lock)
list_push_back (&max_donor->donors_list, list_pop_front (&orphan_list));
}
intr_set_level (old_level);
/* Removal of donors to this thread may change its effective priority,
so recalculate. */
thread_recalculate_priority ();