diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-04-12 10:38:32 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-04-12 11:04:10 +0000 |
commit | 8ddf083330fdad8a153d9084470363ae0c2b3217 (patch) | |
tree | 868ecfa84c780e1ca7de916c622559833defac26 /src/lib/corelib/buildgraph/productbuilddata.cpp | |
parent | 92d0bb4d90ec512e3e1d7d60e98a6af8f242f4de (diff) |
Guard concurrent access of ProductBuildData::m_jsArtifactsMapUpToDate
This fixes a race condition where product.artifacts would contain
outdated information.
Change-Id: I17130a11fbce557314a0157da61c15dae2271189
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/productbuilddata.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/productbuilddata.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/corelib/buildgraph/productbuilddata.cpp b/src/lib/corelib/buildgraph/productbuilddata.cpp index bb1a8d6af..7445c93cb 100644 --- a/src/lib/corelib/buildgraph/productbuilddata.cpp +++ b/src/lib/corelib/buildgraph/productbuilddata.cpp @@ -143,6 +143,16 @@ void ProductBuildData::addRescuableArtifactData(const QString &filePath, m_rescuableArtifactData.insert(filePath, rad); } +bool ProductBuildData::checkAndSetJsArtifactsMapUpToDateFlag() +{ + std::lock_guard<std::mutex> l(m_artifactsMapMutex); + if (!m_jsArtifactsMapUpToDate) { + m_jsArtifactsMapUpToDate = true; + return false; + } + return true; +} + void ProductBuildData::removeArtifactFromSet(Artifact *artifact) { for (const FileTag &t : artifact->fileTags()) |