Mercurial > hg > orthanc
changeset 6968:2c0edc2660f0 streaming
cosmetic changes
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Mon, 29 Jun 2026 16:13:42 +0200 |
| parents | edd68dfbdd98 |
| children | 1f22c8f22ede |
| files | OrthancFramework/Sources/Logging.cpp OrthancFramework/Sources/MultiThreading/ThreadPool.cpp OrthancFramework/Sources/MultiThreading/ThreadPool.h |
| diffstat | 3 files changed, 17 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- 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<boost::shared_mutex> 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_) {
--- 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,
--- 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<MetricsRegistry::SharedMetrics> availableThreadsMetrics_; template <bool throws> @@ -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();
