Merge 'task1/priority-donation' into 'master' #14

Merged
sb3923 merged 66 commits from task1/priority-donation into master 2024-10-23 16:15:45 +00:00
4 changed files with 274 additions and 16 deletions
Showing only changes of commit 4879775d0b - Show all commits

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);