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).
This commit is contained in:
Matthias Moulin 2021-04-22 21:19:54 +02:00 committed by GitHub
parent c5abaeddca
commit 9d3dde0900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ public:
protected:
// sink formatter
std::unique_ptr<spdlog::formatter> formatter_;
Mutex mutex_;
mutable Mutex mutex_;
virtual void sink_it_(const details::log_msg &msg) = 0;
virtual void flush_() = 0;