Enhance logging and task management; enable trace facility, add scheduler state logging, and improve shutdown handling

This commit is contained in:
Lukas Höppner
2026-08-12 14:12:43 +02:00
parent b623e5cf0a
commit b04ba14891
11 changed files with 187 additions and 119 deletions
+6 -2
View File
@@ -145,10 +145,14 @@ internal static class Program
Console.WriteLine("[Sim] Requesting core shutdown...");
if (Nova64Core.nova64_shutdown())
{
if (!_coreThread.Join(TimeSpan.FromSeconds(5)))
int timeoutMs = 1000;
while (!Nova64Core.nova64_is_finalized() && timeoutMs > 0)
{
Console.WriteLine("[Sim] Core thread did not exit in time.");
Thread.Sleep(10);
timeoutMs -= 10;
}
Console.WriteLine($"[Sim] Core shutdown complete after {1000 - timeoutMs}ms.");
_coreThread = null;
}
else
{