From b5f73a99ccc016340cabd6a18ae08a34e2a0a0b0 Mon Sep 17 00:00:00 2001 From: John Gross Date: Mon, 21 Aug 2017 20:39:54 -0700 Subject: [PATCH] Use Thread.IsAlive property --- Torch.Server/TorchServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs index d85ec48..f5a9b56 100644 --- a/Torch.Server/TorchServer.cs +++ b/Torch.Server/TorchServer.cs @@ -183,7 +183,7 @@ namespace Torch.Server if (!mre.WaitOne(TimeSpan.FromSeconds(Instance.Config.TickTimeout))) { var mainThread = MySandboxGame.Static.UpdateThread; - if (mainThread.ThreadState == System.Threading.ThreadState.Running) + if (mainThread.IsAlive) mainThread.Suspend(); var stackTrace = new StackTrace(mainThread, true); throw new TimeoutException($"Server watchdog detected that the server was frozen for at least {((TorchServer)state).Config.TickTimeout} seconds.\n{stackTrace}");