From 08ef88b1565f3e740b0bcba6d013c377dad3b36f Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Sat, 26 Nov 2022 00:17:20 +0530 Subject: [PATCH] Add early-timeout path for `WaitForAddress` --- app/src/main/cpp/skyline/kernel/types/KProcess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp index 303e7a9a..8dd9e43c 100644 --- a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp +++ b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp @@ -309,6 +309,9 @@ namespace skyline::kernel::type { break; } + if (timeout == 0) [[unlikely]] + return result::TimedOut; + auto queue{syncWaiters.equal_range(address)}; syncWaiters.insert(std::upper_bound(queue.first, queue.second, state.thread->priority.load(), [](const i8 priority, const SyncWaiters::value_type &it) { return it.second->priority > priority; }), {address, state.thread});