From c2fbaac300e08085e4787e82e6d45de7d7cd4609 Mon Sep 17 00:00:00 2001 From: Alexandru Macocian Date: Wed, 23 Oct 2019 12:09:09 +0200 Subject: [PATCH] Fixed a bug in which CPUUsageLimiter would not update CPU usage and would keep current thread on sleep indefinitely. --- MTSC/MTSC.csproj | 6 +++--- MTSC/Server/UsageMonitors/CPUUsageLimiter.cs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/MTSC/MTSC.csproj b/MTSC/MTSC.csproj index a7ad732..0defa7a 100644 --- a/MTSC/MTSC.csproj +++ b/MTSC/MTSC.csproj @@ -5,12 +5,12 @@ netcoreapp2.1;net48;netstandard2.0;netcoreapp3.0 - 1.1.0 + 1.1.1 Alexandru-Victor Macocian MTSC Modular TCP Server and Client - 0.1.1.0 - 0.1.1.0 + 0.1.1.1 + 0.1.1.1 true AnyCPU;x64 https://github.com/AlexMacocian/MTSC diff --git a/MTSC/Server/UsageMonitors/CPUUsageLimiter.cs b/MTSC/Server/UsageMonitors/CPUUsageLimiter.cs index 631378d..01d1a22 100644 --- a/MTSC/Server/UsageMonitors/CPUUsageLimiter.cs +++ b/MTSC/Server/UsageMonitors/CPUUsageLimiter.cs @@ -42,6 +42,7 @@ namespace MTSC.Server.UsageMonitors while(cpuUsage > cpuUsageLimit) { Thread.Sleep(10); + PollCPUUsage(); } }