aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-02-11 00:53:31 +0200
committerRiccardo Spagni <ric@spagni.net>2017-02-11 00:53:31 +0200
commitd1b7ad3f1a45efd7abbda5b6de1b044e15ff2be6 (patch)
treefee806fb21a3fe7515dcbdb1643f58b4b2b8ee86
parentMerge pull request #1694 (diff)
parentFix race in setThreadName/getThreadName (diff)
downloadmonero-d1b7ad3f1a45efd7abbda5b6de1b044e15ff2be6.tar.xz
Merge pull request #1696
6ea3e3cc Fix race in setThreadName/getThreadName (Lee Clagett)
-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 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;