# HG changeset patch # User Sebastien Jodogne # Date 1790770643 -7200 # Node ID 22083f3fe932f141e72ee361cfacdb3131b94f2f # Parent 5e8003d46cf53322b9d069aa88c9315ad1d57434 fix compatibility with WebAssembly diff -r 5e8003d46cf5 -r 22083f3fe932 OrthancFramework/Sources/Logging.cpp --- a/OrthancFramework/Sources/Logging.cpp Tue Sep 29 17:06:35 2026 +0200 +++ b/OrthancFramework/Sources/Logging.cpp Wed Sep 30 14:17:23 2026 +0200 @@ -25,13 +25,12 @@ #include "PrecompiledHeaders.h" #include "Logging.h" +#include "MultiThreading/ReaderWriterLock.h" #include "OrthancException.h" #include #include #include -#include -#include // For boost::unique_lock<> and boost::shared_lock<> #if defined(__linux__) && !defined(NDEBUG) @@ -55,7 +54,7 @@ static uint32_t traceCategoriesMask_ = 0; static std::string logTargetFolder_; // keep a track of the log folder in case of reset of the context static std::string logTargetFile_; // keep a track of the log file in case of reset of the context - static boost::shared_mutex messageIdsMutex_; + static ReaderWriterLock messageIdsMutex_; static std::set disabledMessageIds_; const char* EnumerationToString(LogLevel level) @@ -149,7 +148,7 @@ void SetMessageIdEnabled(const std::string& messageId, bool enabled) { - boost::unique_lock lock(messageIdsMutex_); + ReaderWriterLock::WriteLock lock(messageIdsMutex_); if (enabled) { @@ -163,9 +162,9 @@ bool IsMessageIdEnabled(const std::string& messageId) { - boost::shared_lock lock(messageIdsMutex_); + ReaderWriterLock::ReadLock lock(messageIdsMutex_); - return disabledMessageIds_.find(messageId) == disabledMessageIds_.end(); + return (disabledMessageIds_.find(messageId) == disabledMessageIds_.end()); }