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 authored and GitHub committed 2019-11-23 13:24:39 -05:00
commit 6a3fc5d2ff
5 files changed
+74 -22

No files matched your search

+8
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;
}