diff --git a/src/threads/synch.c b/src/threads/synch.c index 73dceba..655e014 100644 --- a/src/threads/synch.c +++ b/src/threads/synch.c @@ -436,11 +436,12 @@ cond_signal (struct condition *cond, struct lock *lock UNUSED) if (!list_empty (&cond->waiters)) { + /* Enforce wake-up of highest priority thread within the singleton + semaphores waiting for condvar. */ struct list_elem *e = list_min (&cond->waiters, sema_priority_more, NULL); list_remove (e); sema_up (&list_entry (e, struct semaphore_elem, elem)->semaphore); } - } /* Wakes up all threads, if any, waiting on COND (protected by