From 2ed92c4aa14aa606c4f5fbd9c44324df32c5e126 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Wed, 20 Jul 2022 14:42:07 +0200 Subject: [PATCH] fix plugin monitor eating a whole cpu core i must have messed this up when i changed the plugin monitor behavior recently --- src/TPluginMonitor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/TPluginMonitor.cpp b/src/TPluginMonitor.cpp index 9553f5d..df575f1 100644 --- a/src/TPluginMonitor.cpp +++ b/src/TPluginMonitor.cpp @@ -60,10 +60,8 @@ void TPluginMonitor::operator()() { } catch (const std::exception& e) { ToRemove.push_back(Pair.first); } - for (size_t i = 0; i < 3 && !Application::IsShuttingDown(); ++i) { - std::this_thread::sleep_for(std::chrono::seconds(1)); - } } + Application::SleepSafeSeconds(3); for (const auto& File : ToRemove) { mFileTimes.erase(File); beammp_warnf("File \"{}\" couldn't be accessed, so it was removed from plugin hot reload monitor (probably got deleted)", File);