Merge pull request #3114 from FernandoS27/cond-var

Kernel: Correct behavior of Condition Variables to be more similar to real hardware.
This commit is contained in:
bunnei 2019-11-23 13:24:39 -05:00 committed by GitHub
commit 6a3fc5d2ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 74 additions and 22 deletions

View file

@ -309,8 +309,16 @@ void Thread::UpdatePriority() {
return;
}
if (GetStatus() == ThreadStatus::WaitCondVar) {
owner_process->RemoveConditionVariableThread(this);
}
SetCurrentPriority(new_priority);
if (GetStatus() == ThreadStatus::WaitCondVar) {
owner_process->InsertConditionVariableThread(this);
}
if (!lock_owner) {
return;
}