mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 11:35:46 +00:00
WaitSynchronizationN: Refactor to fix several bugs
- Separate wait checking from waiting the current thread - Resume thread when wait_all=true only if all objects are available at once - Set output to correct wait object index when there are duplicate handles
This commit is contained in:
parent
aa01c57ae9
commit
6643673f28
8 changed files with 75 additions and 78 deletions
|
@ -32,11 +32,11 @@ public:
|
|||
return available_count > 0;
|
||||
}
|
||||
|
||||
ResultVal<bool> Wait(unsigned index) override {
|
||||
ResultVal<bool> Wait(bool wait_thread) override {
|
||||
bool wait = !IsAvailable();
|
||||
|
||||
if (wait) {
|
||||
Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_SEMA, this, index);
|
||||
if (wait && wait_thread) {
|
||||
Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_SEMA, this);
|
||||
AddWaitingThread(GetCurrentThread());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue