diff --git a/src/threads/thread.c b/src/threads/thread.c index b626a96..f937aca 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -405,14 +405,15 @@ thread_recalculate_priority (void) struct thread *t = thread_current (); t->priority = t->base_priority; - if (!list_empty (&t->donors_list)) { - int max_donated_priority = - list_entry (list_max (&t->donors_list, priority_more, NULL), - struct thread, donor_elem)->priority; + if (!list_empty (&t->donors_list)) + { + int max_donated_priority = + list_entry (list_max (&t->donors_list, priority_more, NULL), + struct thread, donor_elem)->priority; - if (max_donated_priority > t->priority) - t->priority = max_donated_priority; - } + if (max_donated_priority > t->priority) + t->priority = max_donated_priority; + } } /* Sets the current thread's nice value to NICE. */