mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 12:18:09 -05:00
Kernel: Separate WaitSynchronization into Wait and Acquire methods.
This commit is contained in:
@ -32,18 +32,27 @@ public:
|
||||
return available_count > 0;
|
||||
}
|
||||
|
||||
ResultVal<bool> WaitSynchronization(unsigned index) override {
|
||||
ResultVal<bool> Wait(unsigned index) override {
|
||||
bool wait = !IsAvailable();
|
||||
|
||||
if (wait) {
|
||||
Kernel::WaitCurrentThread_WaitSynchronization(WAITTYPE_SEMA, this, index);
|
||||
AddWaitingThread(GetCurrentThread());
|
||||
} else {
|
||||
--available_count;
|
||||
}
|
||||
|
||||
return MakeResult<bool>(wait);
|
||||
}
|
||||
|
||||
ResultVal<bool> Acquire() override {
|
||||
bool res = false;
|
||||
|
||||
if (IsAvailable()) {
|
||||
--available_count;
|
||||
res = true;
|
||||
}
|
||||
|
||||
return MakeResult<bool>(res);
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user