From dfdd06b24c49eaf1f2bbc241bec47970d470b54b Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 15 Feb 2024 22:10:11 +0100 Subject: [PATCH] impr: Set name of background service thread --- lib/libimhex/source/api/content_registry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libimhex/source/api/content_registry.cpp b/lib/libimhex/source/api/content_registry.cpp index 9efcdcfb6..a57c33799 100644 --- a/lib/libimhex/source/api/content_registry.cpp +++ b/lib/libimhex/source/api/content_registry.cpp @@ -15,6 +15,7 @@ #include #endif +#include #include #include @@ -1081,7 +1082,8 @@ namespace hex { impl::s_services->emplace_back( unlocalizedName, - std::jthread([callback = auto(callback)](const std::stop_token &stopToken){ + std::jthread([=](const std::stop_token &stopToken){ + TaskManager::setCurrentThreadName(Lang(unlocalizedName)); while (!stopToken.stop_requested()) { callback(); std::this_thread::sleep_for(std::chrono::milliseconds(50));