# HG changeset patch # User Sebastien Jodogne # Date 1782742422 -7200 # Node ID 2c0edc2660f0d5076a2aa9c8da28cd009ae399f4 # Parent edd68dfbdd98961db5d1c4394e9a6f14b7444f9f cosmetic changes diff -r edd68dfbdd98 -r 2c0edc2660f0 OrthancFramework/Sources/Logging.cpp --- a/OrthancFramework/Sources/Logging.cpp Mon Jun 29 16:03:00 2026 +0200 +++ b/OrthancFramework/Sources/Logging.cpp Mon Jun 29 16:13:42 2026 +0200 @@ -752,7 +752,7 @@ } - class Reader : public boost::noncopyable + class CurrentThreadReader : public boost::noncopyable { private: boost::shared_lock lock_; @@ -761,7 +761,7 @@ const ThreadInformation* information_; public: - explicit Reader(ThreadsInformations& informations) : + explicit CurrentThreadReader(ThreadsInformations& informations) : lock_(informations.mutex_), threadId_(boost::this_thread::get_id()), exists_(false), @@ -825,7 +825,7 @@ }; - class Writer : public boost::noncopyable + class CurrentThreadWriter : public boost::noncopyable { private: ThreadsInformations& informations_; @@ -834,7 +834,7 @@ ThreadInformation* information_; public: - explicit Writer(ThreadsInformations& informations) : + explicit CurrentThreadWriter(ThreadsInformations& informations) : informations_(informations), lock_(informations.mutex_), threadId_(boost::this_thread::get_id()) @@ -995,7 +995,7 @@ if (pluginContext_ == NULL) { { - ThreadsInformations::Writer writer(threadsInformations_); + ThreadsInformations::CurrentThreadWriter writer(threadsInformations_); writer.SetThreadName(name); } @@ -1015,7 +1015,7 @@ { if (pluginContext_ == NULL) { - ThreadsInformations::Reader reader(threadsInformations_); + ThreadsInformations::CurrentThreadReader reader(threadsInformations_); return reader.HasThreadName(); } else @@ -1029,7 +1029,7 @@ { if (pluginContext_ == NULL) { - ThreadsInformations::Writer writer(threadsInformations_); + ThreadsInformations::CurrentThreadWriter writer(threadsInformations_); writer.ClearThreadName(); } else if (hasClearThreadName_) // only recent runtimes support it (from 1.12.12) @@ -1043,7 +1043,7 @@ { if (pluginContext_ == NULL) { - ThreadsInformations::Reader reader(threadsInformations_); + ThreadsInformations::CurrentThreadReader reader(threadsInformations_); return reader.GetThreadName(); } else @@ -1061,7 +1061,7 @@ } else { - ThreadsInformations::Writer writer(threadsInformations_); + ThreadsInformations::CurrentThreadWriter writer(threadsInformations_); writer.PushContext(context); } } @@ -1069,7 +1069,7 @@ void PopCurrentThreadContext() { - ThreadsInformations::Writer writer(threadsInformations_); + ThreadsInformations::CurrentThreadWriter writer(threadsInformations_); writer.PopContext(); } @@ -1110,7 +1110,7 @@ ThreadContextMemento::ThreadContextMemento() : pimpl_(new PImpl) { - ThreadsInformations::Reader reader(threadsInformations_); + ThreadsInformations::CurrentThreadReader reader(threadsInformations_); reader.CopyContext(pimpl_->context_); } @@ -1214,7 +1214,7 @@ if (enableThreadNames_ || enableThreadContexts_) { - ThreadsInformations::Reader reader(threadsInformations_); + ThreadsInformations::CurrentThreadReader reader(threadsInformations_); if (enableThreadNames_) { diff -r edd68dfbdd98 -r 2c0edc2660f0 OrthancFramework/Sources/MultiThreading/ThreadPool.cpp --- a/OrthancFramework/Sources/MultiThreading/ThreadPool.cpp Mon Jun 29 16:03:00 2026 +0200 +++ b/OrthancFramework/Sources/MultiThreading/ThreadPool.cpp Mon Jun 29 16:13:42 2026 +0200 @@ -40,7 +40,8 @@ namespace Orthanc { - void ThreadPool::SetMetricsConfiguration(MetricsRegistry& metrics, const std::string& availableThreadsMetricName) + void ThreadPool::SetMetricsConfiguration(MetricsRegistry& metrics, + const std::string& availableThreadsMetricName) { availableThreadsMetrics_.reset(new MetricsRegistry::SharedMetrics(metrics, availableThreadsMetricName, diff -r edd68dfbdd98 -r 2c0edc2660f0 OrthancFramework/Sources/MultiThreading/ThreadPool.h --- a/OrthancFramework/Sources/MultiThreading/ThreadPool.h Mon Jun 29 16:03:00 2026 +0200 +++ b/OrthancFramework/Sources/MultiThreading/ThreadPool.h Mon Jun 29 16:13:42 2026 +0200 @@ -54,6 +54,7 @@ unsigned int countThreads_; State state_; unsigned int dequeueTimeoutMilliseconds_; + std::unique_ptr availableThreadsMetrics_; template @@ -76,7 +77,8 @@ unsigned int GetDequeueTimeout(); - void SetMetricsConfiguration(MetricsRegistry& metrics, const std::string& availableThreadsMetricName); + void SetMetricsConfiguration(MetricsRegistry& metrics, + const std::string& availableThreadsMetricName); void Start();