mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 19:55:46 +00:00
Kernel: Correct behavior of Condition Variables to be more similar to real hardware.
This commit ensures cond var threads act exactly as they do in the real console. The original implementation uses an RBTree and the behavior of cond var threads is that at the same priority level they act like a FIFO.
This commit is contained in:
parent
424a78bd3f
commit
b021fa33b9
5 changed files with 74 additions and 15 deletions
|
@ -306,8 +306,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue