diff options
author | Lee Clagett <code@leeclagett.com> | 2017-02-07 21:33:26 -0500 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2017-02-07 21:33:26 -0500 |
commit | 6ea3e3ccc7c0e6cd77a2f5c97df968518e734bd7 (patch) | |
tree | ee327d6a4b6e0440bb0a5a545fb8f5d5994d0ce3 /external/easylogging++/easylogging++.h | |
parent | Merge pull request #1655 (diff) | |
download | monero-6ea3e3ccc7c0e6cd77a2f5c97df968518e734bd7.tar.xz |
Fix race in setThreadName/getThreadName
Diffstat (limited to 'external/easylogging++/easylogging++.h')
-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 d28152667..64bfa58cb 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; |