mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
logging: Add threadsafety comments
This commit is contained in:
parent
0b282f9b00
commit
faa2a47cd7
2 changed files with 13 additions and 9 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue