[Kernel::WaitSync1] Instant timeout if ns == 0

This commit is contained in:
wheremyfoodat 2023-04-20 02:48:57 +03:00
parent 2b492a435e
commit 920fd4cf0d
2 changed files with 9 additions and 0 deletions
src/core/kernel

View file

@ -103,6 +103,12 @@ void Kernel::waitSynchronization1() {
if (!shouldWaitOnObject(object)) {
regs[0] = SVCResult::Success;
} else {
// Timeout is 0, don't bother waiting, instantly timeout
if (ns == 0) {
regs[0] = SVCResult::Timeout;
return;
}
regs[0] = SVCResult::Success;
auto& t = threads[currentThreadIndex];