aboutsummaryrefslogtreecommitdiff
path: root/src/logging.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-05-28 10:39:29 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-05-28 14:27:08 -0400
commitfaa2a47cd7bcdbd187035c76f8dbd0442f6818dc (patch)
tree55d94c93f37e77734e8c0b50ccd6c9419fc59dc2 /src/logging.cpp
parent0b282f9b00da08734e2381477aad32d64b933745 (diff)
logging: Add threadsafety comments
Diffstat (limited to 'src/logging.cpp')
-rw-r--r--src/logging.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/logging.cpp b/src/logging.cpp
index 268614065a..418a701179 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -41,7 +41,7 @@ static int FileWriteStr(const std::string &str, FILE *fp)
bool BCLog::Logger::StartLogging()
{
- std::lock_guard<std::mutex> scoped_lock(m_file_mutex);
+ std::lock_guard<std::mutex> scoped_lock(m_cs);
assert(m_buffering);
assert(m_fileout == nullptr);
@@ -216,9 +216,9 @@ std::string BCLog::Logger::LogTimestampStr(const std::string& str)
return strStamped;
}
-void BCLog::Logger::LogPrintStr(const std::string &str)
+void BCLog::Logger::LogPrintStr(const std::string& str)
{
- std::lock_guard<std::mutex> scoped_lock(m_file_mutex);
+ std::lock_guard<std::mutex> scoped_lock(m_cs);
std::string str_prefixed = str;
if (m_log_threadnames && m_started_new_line) {