From 24dde318fe034f0c7e809daa5a6e81dc85e1155a Mon Sep 17 00:00:00 2001 From: Matteo Del Seppia <71389092+matteodelseppia@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:53:34 +0100 Subject: [PATCH] Adding lock to rotate_now() (#3281) --- 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_(); }