aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljsmodelmanagerinterface.h
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2020-05-10 16:00:31 +0200
committerChristian Kamm <[email protected]>2020-05-21 07:53:11 +0000
commit96c860159b862460e21be16a6e2839c0b591e016 (patch)
tree49222c0a7f9dc4ccc1286ceaa84a0c05e53bc55c /src/libs/qmljs/qmljsmodelmanagerinterface.h
parent037ff590e6b3fc930a60a06979d0062108829268 (diff)
QmlJS: Track futures to allow testing
Tests often want to wait for all async tasks to finish before progressing. Change-Id: I61738df730ca341b5c9d227569d961cd1991b296 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Philip Van Hoof <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.h')
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h
index 4337adcb794..8e8b9d2a24c 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.h
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h
@@ -179,8 +179,9 @@ public:
virtual ProjectInfo defaultProjectInfoForProject(ProjectExplorer::Project *project) const;
- // Blocks until all parsing threads are done. Used for testing.
- void joinAllThreads();
+ // Blocks until all parsing threads are done. Use for testing only!
+ void test_joinAllThreads();
+ void addFuture(const QFuture<void> &future);
QmlJS::Document::Ptr ensuredGetDocumentForPath(const QString &filePath);
static void importScan(QFutureInterface<void> &future, const WorkingCopy& workingCopyInternal,
@@ -271,7 +272,9 @@ private:
PluginDumper *m_pluginDumper = nullptr;
+ mutable QMutex m_futuresMutex;
QList<QFuture<void>> m_futures;
+
bool m_indexerDisabled = false;
};