Don't unlock the mutex around openFile. It is a recursive mutex so we should be able to stay locked

This commit is contained in:
Isaac Connor 2021-03-05 14:13:10 -05:00
parent 0af68a0914
commit f99b8896ec
1 changed files with 3 additions and 2 deletions

View File

@ -510,10 +510,11 @@ void Logger::logPrint(bool hex, const char * const filepath, const int line, con
if (level <= mFileLevel) {
if (!mLogFileFP) {
// FIXME unlocking here is a problem. Another thread could sneak in.
log_mutex.unlock();
// We are using a recursive mutex so unlocking shouldn't be neccessary
//log_mutex.unlock();
// We do this here so that we only create the file if we ever write to it.
openFile();
log_mutex.lock();
//log_mutex.lock();
}
if (mLogFileFP) {
fputs(logString, mLogFileFP);