mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 12:48:01 -05: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:
@ -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());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user