# HG changeset patch # User Alain Mazy # Date 1770973512 -3600 # Node ID 9a7eedece65fbf34f3fc3abf70c4abc8658e1a84 # Parent 743e4bf6a23d182632a0f851480ec99b9dcb47f3 fix WADO-LOAD-xxx thread names diff -r 743e4bf6a23d -r 9a7eedece65f Plugin/WadoRs.cpp --- a/Plugin/WadoRs.cpp Tue Jan 27 17:00:34 2026 +0100 +++ b/Plugin/WadoRs.cpp Fri Feb 13 10:05:12 2026 +0100 @@ -57,6 +57,10 @@ static bool pluginCanUseExtendedFind_ = false; static bool isSystemReadOnly_ = false; +static boost::mutex preloaderThreadsCounterMutex; +static uint32_t preloaderThreadsCounter = 0; + + void SetPluginCanUseExtendedFind(bool enable) { pluginCanUseExtendedFind_ = enable; @@ -515,8 +519,11 @@ static void PreloaderWorkerThread(ThreadedInstanceLoader* that) { - static uint16_t threadCounter = 0; - Orthanc::Logging::SetCurrentThreadName(std::string("WADO-LOAD-") + boost::lexical_cast(threadCounter++)); + { + boost::mutex::scoped_lock lock(preloaderThreadsCounterMutex); + Orthanc::Logging::SetCurrentThreadName(std::string("WADO-LOAD-") + boost::lexical_cast(preloaderThreadsCounter++)); + preloaderThreadsCounter %= 1000000; + } LOG(INFO) << "Loader thread has started";