[Kernel::WaitSync1] Instant timeout if ns == 0
This commit is contained in:
@@ -23,6 +23,9 @@ namespace SVCResult {
|
||||
|
||||
BadThreadPriority = 0xE0E01BFD,
|
||||
PortNameTooLong = 0xE0E0181E,
|
||||
|
||||
// Returned when a thread stops waiting due to timing out
|
||||
Timeout = 0x9401BFE,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user