diff --git a/src/threads/thread.c b/src/threads/thread.c index 8731b3b..dd594d9 100644 --- a/src/threads/thread.c +++ b/src/threads/thread.c @@ -417,6 +417,8 @@ void thread_recalculate_priority (void) { struct thread *t = thread_current (); + + enum intr_level old_level = intr_disable (); t->priority = t->base_priority; /* If there are no donors to the current thread, then the effective @@ -432,6 +434,7 @@ thread_recalculate_priority (void) if (max_donated_priority > t->priority) t->priority = max_donated_priority; } + intr_set_level (old_level); } /* Sets the current thread's nice value to NICE. */