From 1bea5145b76e642284e9cd1a57b2fe5c85b8a35f Mon Sep 17 00:00:00 2001 From: Matteo Del Seppia Date: Tue, 3 Dec 2024 07:19:24 +0100 Subject: [PATCH] Adding lock to rotate_now() --- include/spdlog/sinks/rotating_file_sink-inl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index 9f9aa47a..420bafb0 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -71,6 +71,7 @@ SPDLOG_INLINE filename_t rotating_file_sink::filename() { template SPDLOG_INLINE void rotating_file_sink::rotate_now() { + std::lock_guard lock(base_sink::mutex_); rotate_(); }