diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-02-11 00:53:31 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-02-11 00:53:31 +0200 |
commit | d1b7ad3f1a45efd7abbda5b6de1b044e15ff2be6 (patch) | |
tree | fee806fb21a3fe7515dcbdb1643f58b4b2b8ee86 /external/easylogging++ | |
parent | Merge pull request #1694 (diff) | |
parent | Fix race in setThreadName/getThreadName (diff) | |
download | monero-d1b7ad3f1a45efd7abbda5b6de1b044e15ff2be6.tar.xz |
Merge pull request #1696
6ea3e3cc Fix race in setThreadName/getThreadName (Lee Clagett)
Diffstat (limited to 'external/easylogging++')
-rw-r--r-- | external/easylogging++/easylogging++.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h index 3b58c0fec..24e271e80 100644 --- a/external/easylogging++/easylogging++.h +++ b/external/easylogging++/easylogging++.h @@ -3988,10 +3988,12 @@ inline void FUNCTION_NAME(const T&); } void setThreadName(const std::string &name) { + const base::threading::ScopedLock scopedLock(lock()); m_threadNames[base::threading::getCurrentThreadId()] = name; } std::string getThreadName(const std::string& name) { + const base::threading::ScopedLock scopedLock(lock()); std::map<std::string, std::string>::const_iterator it = m_threadNames.find(name); if (it == m_threadNames.end()) return name; |