From 425db6410450b275c87ed1769dc2bfe86d0a4034 Mon Sep 17 00:00:00 2001 From: AdvDebug <90452585+AdvDebug@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:36:16 +0300 Subject: [PATCH] Fix scheduler redundant loop Fix scheduler redundant loop when the main (or other) thread dies, causing the emulator to loop unnecessarily. --- Brovan/Core/Emulation/BinaryEmulator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Brovan/Core/Emulation/BinaryEmulator.cs b/Brovan/Core/Emulation/BinaryEmulator.cs index 4914124..2acda68 100644 --- a/Brovan/Core/Emulation/BinaryEmulator.cs +++ b/Brovan/Core/Emulation/BinaryEmulator.cs @@ -2266,7 +2266,7 @@ namespace Brovan.Core.Emulation return true; } - if (TryGetNextWaitSleepMs(out int SleepMs)) + if (TryGetNextWaitSleepMs(out int SleepMs, int.MaxValue)) { if (Debug) TriggerDebugMessage($"scheduler: no runnable thread, advancing guest time by {SleepMs}ms"); @@ -3280,4 +3280,4 @@ namespace Brovan.Core.Emulation //~BinaryEmulator() => Dispose(); } -} \ No newline at end of file +}