Commit de7c0767 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Use recursive mutex on log calls because some call arguments can themselves...

Use recursive mutex on log calls because some call arguments can themselves call the log. Caused actual deadlocks in recoll 1.23 GUI with high verbosity
parent 139e1c56
......@@ -31,7 +31,7 @@ Logger::Logger(const std::string& fn)
bool Logger::reopen(const std::string& fn)
{
#if LOGGER_THREADSAFE
std::unique_lock<std::mutex> lock(m_mutex);
std::unique_lock<std::recursive_mutex> lock(m_mutex);
#endif
if (!fn.empty()) {
m_fn = fn;
......
......@@ -73,7 +73,7 @@ public:
}
#if LOGGER_THREADSAFE
std::mutex& getmutex() {
std::recursive_mutex& getmutex() {
return m_mutex;
}
#endif
......@@ -84,7 +84,7 @@ private:
std::string m_fn;
std::ofstream m_stream;
#if LOGGER_THREADSAFE
std::mutex m_mutex;
std::recursive_mutex m_mutex;
#endif
Logger(const std::string& fn);
......@@ -96,7 +96,7 @@ private:
#if LOGGER_THREADSAFE
#define LOGGER_LOCK \
std::unique_lock<std::mutex> lock(Logger::getTheLog("")->getmutex())
std::unique_lock<std::recursive_mutex> lock(Logger::getTheLog("")->getmutex())
#else
#define LOGGER_LOCK
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment