diff --git a/lib/libimhex/include/hex/helpers/logger.hpp b/lib/libimhex/include/hex/helpers/logger.hpp index 17f4aae1e..83ca8a604 100644 --- a/lib/libimhex/include/hex/helpers/logger.hpp +++ b/lib/libimhex/include/hex/helpers/logger.hpp @@ -19,7 +19,7 @@ namespace hex::log { [[maybe_unused]] void redirectToFile(); [[maybe_unused]] void enableColorPrinting(); - [[nodiscard]] std::mutex& getLoggerMutex(); + [[nodiscard]] std::recursive_mutex& getLoggerMutex(); [[nodiscard]] bool isLoggingSuspended(); struct LogEntry { diff --git a/lib/libimhex/source/helpers/logger.cpp b/lib/libimhex/source/helpers/logger.cpp index 3c8b28b36..00bfcf50d 100644 --- a/lib/libimhex/source/helpers/logger.cpp +++ b/lib/libimhex/source/helpers/logger.cpp @@ -18,7 +18,7 @@ namespace hex::log { wolv::io::File s_loggerFile; bool s_colorOutputEnabled = false; - std::mutex s_loggerMutex; + std::recursive_mutex s_loggerMutex; bool s_loggingSuspended = false; } @@ -33,7 +33,7 @@ namespace hex::log { namespace impl { - std::mutex& getLoggerMutex() { + std::recursive_mutex& getLoggerMutex() { return s_loggerMutex; }