Added: #1440 Mutex while initializing file status cache

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 6ce855c1b6
commit 7cdd522f51

@ -107,6 +107,7 @@ public:
bool m_AbortRequested; bool m_AbortRequested;
CProcessResult m_ResultPreviousSuccess; CProcessResult m_ResultPreviousSuccess;
CMutex m_FileStatusInitializeMutex;
std::map<std::string, CFileStatus> m_FileStatusCache; std::map<std::string, CFileStatus> m_FileStatusCache;
CProcessResult m_ResultCurrent; CProcessResult m_ResultCurrent;
@ -488,8 +489,10 @@ public:
nldebug("Add file status: '%s' (macro path)", macroPath.c_str()); nldebug("Add file status: '%s' (macro path)", macroPath.c_str());
std::string filePath = unMacroPath(macroPath); std::string filePath = unMacroPath(macroPath);
nlassert(m_FileStatusCache.find(filePath) == m_FileStatusCache.end()); m_FileStatusInitializeMutex.enter();
nlassert(m_FileStatusCache.find(filePath) == m_FileStatusCache.end()); // for now don't allow depending on own output within process :)
m_FileStatusCache[filePath] = fileStatus; m_FileStatusCache[filePath] = fileStatus;
m_FileStatusInitializeMutex.leave();
} }
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////

Loading…
Cancel
Save