Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginClass.cpp

Issue 5189151393579008: Issue 2142 - Synchronize access to s_threadInstances in CPluginClass::OnTabChanged
Patch Set: Created March 16, 2015, 10:57 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginClass.cpp
===================================================================
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -609,7 +609,9 @@
std::map<DWORD,CPluginClass*>::const_iterator it = s_threadInstances.find(GetCurrentThreadId());
if (it == s_threadInstances.end())
{
+ s_criticalSectionLocal.Lock();
Eric 2015/03/16 12:19:44 The atomic action required here needs to surround
s_threadInstances[::GetCurrentThreadId()] = this;
+ s_criticalSectionLocal.Unlock();
if (!m_isInitializedOk)
{
m_isInitializedOk = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld