diff --git a/src/threads/synch.c b/src/threads/synch.c index 940faa5..1246206 100644 --- a/src/threads/synch.c +++ b/src/threads/synch.c @@ -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 ();