Update donate priority to add an assertion that intrrupts are disabled, w/ T

This commit is contained in:
sBubshait
2024-10-23 16:32:40 +01:00
parent 6223846fde
commit 4879775d0b

View File

@@ -196,9 +196,12 @@ lock_init (struct lock *lock)
/* Current thread donates its priority to donee, iteratively
propagating the donation in the case of chains in the wait-for graph.
Also keeps track of the donation by updating the donors list. */
Also keeps track of the donation by updating the donors list. Expects
interrupts to be disabled. */
static void
donate_priority (struct thread *donee) {
ASSERT (intr_get_level () == INTR_OFF);
struct thread *donor = thread_current ();
list_push_back (&donee->donors_list, &donor->donor_elem);