Allow priority donation with BSD scheduler.
- Recalculate priority with donations after BSD priority updates - Remove mlfqs checks from lock_acquire
This commit is contained in:
@@ -252,26 +252,17 @@ lock_acquire (struct lock *lock)
|
||||
|
||||
struct thread *t = thread_current ();
|
||||
|
||||
if(!thread_mlfqs)
|
||||
{
|
||||
|
||||
enum intr_level old_level = intr_disable ();
|
||||
|
||||
if (lock->holder != NULL)
|
||||
{
|
||||
t->waiting_lock = lock;
|
||||
donate_priority (lock->holder);
|
||||
}
|
||||
|
||||
intr_set_level (old_level);
|
||||
}
|
||||
|
||||
|
||||
enum intr_level old_level = intr_disable ();
|
||||
if (lock->holder != NULL)
|
||||
{
|
||||
t->waiting_lock = lock;
|
||||
donate_priority (lock->holder);
|
||||
}
|
||||
intr_set_level (old_level);
|
||||
|
||||
sema_down (&lock->semaphore);
|
||||
lock->holder = thread_current ();
|
||||
if (!thread_mlfqs)
|
||||
t->waiting_lock = NULL;
|
||||
t->waiting_lock = NULL;
|
||||
}
|
||||
|
||||
/* Tries to acquires LOCK and returns true if successful or false
|
||||
|
||||
Reference in New Issue
Block a user