CppTools: Fix potential race condition

...when acessing m_headerPaths, m_projectFiles or m_definedMacros from
different threads.

ensureUpdated() locked the mutex before writing the variables, but
reading them happened with an unlocked mutex.

Change-Id: I4951fd58f1939e4e50534a018dd600004789668e
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-11-06 16:50:02 +01:00
committed by Erik Verbruggen
parent 4bf0ca6beb
commit 9d7b054120
2 changed files with 13 additions and 7 deletions

View File

@@ -109,7 +109,7 @@ public:
QList<ProjectPart::Ptr> projectPartFromDependencies(const Utils::FileName &fileName) const;
/// \return A synthetic \c ProjectPart which consists of all defines/includes/frameworks from
/// all loaded projects.
ProjectPart::Ptr fallbackProjectPart() const;
ProjectPart::Ptr fallbackProjectPart();
CPlusPlus::Snapshot snapshot() const;
Document::Ptr document(const QString &fileName) const;