changeset 7164:22083f3fe932

fix compatibility with WebAssembly
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Sep 2026 14:17:23 +0200
parents 5e8003d46cf5
children 6d0f6a686b71
files OrthancFramework/Sources/Logging.cpp
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 <cassert>
 #include <stdint.h>
 #include <string.h>
-#include <boost/thread/shared_mutex.hpp>
-#include <boost/thread/lock_types.hpp>  // 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<std::string> disabledMessageIds_;
 
     const char* EnumerationToString(LogLevel level)
@@ -149,7 +148,7 @@
     void SetMessageIdEnabled(const std::string& messageId, 
                              bool enabled)
     {
-      boost::unique_lock<boost::shared_mutex> lock(messageIdsMutex_);
+      ReaderWriterLock::WriteLock lock(messageIdsMutex_);
 
       if (enabled)
       {
@@ -163,9 +162,9 @@
 
     bool IsMessageIdEnabled(const std::string& messageId)
     {
-      boost::shared_lock<boost::shared_mutex> lock(messageIdsMutex_);
+      ReaderWriterLock::ReadLock lock(messageIdsMutex_);
 
-      return disabledMessageIds_.find(messageId) == disabledMessageIds_.end();
+      return (disabledMessageIds_.find(messageId) == disabledMessageIds_.end());
     }