From 9d3dde0900bc8e8b09a4f54e7b9ee7263f57acb0 Mon Sep 17 00:00:00 2001 From: Matthias Moulin Date: Thu, 22 Apr 2021 21:19:54 +0200 Subject: [PATCH] Made mutex member variable mutable Classes inheriting from `base_sink` can now lock the base mutex inside their `const` member methods (e.g., basic accessors). --- include/spdlog/sinks/base_sink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/sinks/base_sink.h b/include/spdlog/sinks/base_sink.h index bf5072f8..0647f0c4 100644 --- a/include/spdlog/sinks/base_sink.h +++ b/include/spdlog/sinks/base_sink.h @@ -37,7 +37,7 @@ public: protected: // sink formatter std::unique_ptr formatter_; - Mutex mutex_; + mutable Mutex mutex_; virtual void sink_it_(const details::log_msg &msg) = 0; virtual void flush_() = 0;