aboutsummaryrefslogtreecommitdiff
path: root/external/easylogging++
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2017-02-07 21:33:26 -0500
committerLee Clagett <code@leeclagett.com>2017-02-07 21:33:26 -0500
commit6ea3e3ccc7c0e6cd77a2f5c97df968518e734bd7 (patch)
treeee327d6a4b6e0440bb0a5a545fb8f5d5994d0ce3 /external/easylogging++
parentMerge pull request #1655 (diff)
downloadmonero-6ea3e3ccc7c0e6cd77a2f5c97df968518e734bd7.tar.xz
Fix race in setThreadName/getThreadName
Diffstat (limited to 'external/easylogging++')
-rw-r--r--external/easylogging++/easylogging++.h2
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;