Fix Bug in Implementation of recalculate priority setting base priority, w/ T
This commit is contained in:
@@ -386,10 +386,7 @@ thread_set_priority (int new_base_priority)
|
||||
return;
|
||||
|
||||
t->base_priority = new_base_priority;
|
||||
t->priority = new_base_priority;
|
||||
|
||||
if (new_base_priority < old_priority)
|
||||
thread_recalculate_priority ();
|
||||
thread_recalculate_priority ();
|
||||
|
||||
thread_yield ();
|
||||
}
|
||||
@@ -406,6 +403,7 @@ void
|
||||
thread_recalculate_priority (void)
|
||||
{
|
||||
struct thread *t = thread_current ();
|
||||
t->priority = t->base_priority;
|
||||
|
||||
if (!list_empty (&t->donors_list)) {
|
||||
int max_donated_priority =
|
||||
|
||||
Reference in New Issue
Block a user