TestCodeParser: Apply priority to thead pool

Rather to async task.

Change-Id: I253de9f04e655e394027d15273a86049f5b61f5b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2023-03-07 17:31:48 +01:00
parent cfedbb2cb0
commit 8240333f96

View File

@@ -50,6 +50,7 @@ TestCodeParser::TestCodeParser()
m_reparseTimer.setSingleShot(true); m_reparseTimer.setSingleShot(true);
connect(&m_reparseTimer, &QTimer::timeout, this, &TestCodeParser::parsePostponedFiles); connect(&m_reparseTimer, &QTimer::timeout, this, &TestCodeParser::parsePostponedFiles);
m_threadPool->setMaxThreadCount(std::max(QThread::idealThreadCount()/4, 1)); m_threadPool->setMaxThreadCount(std::max(QThread::idealThreadCount()/4, 1));
m_threadPool->setThreadPriority(QThread::LowestPriority);
m_futureSynchronizer.setCancelOnWait(true); m_futureSynchronizer.setCancelOnWait(true);
} }
@@ -361,7 +362,6 @@ void TestCodeParser::scanForTests(const FilePaths &fileList, const QList<ITestPa
const auto setup = [this, codeParsers, file](AsyncTask<TestParseResultPtr> &async) { const auto setup = [this, codeParsers, file](AsyncTask<TestParseResultPtr> &async) {
async.setConcurrentCallData(parseFileForTests, codeParsers, file); async.setConcurrentCallData(parseFileForTests, codeParsers, file);
async.setThreadPool(m_threadPool); async.setThreadPool(m_threadPool);
async.setPriority(QThread::LowestPriority);
async.setFutureSynchronizer(&m_futureSynchronizer); async.setFutureSynchronizer(&m_futureSynchronizer);
}; };
const auto onDone = [this](const AsyncTask<TestParseResultPtr> &async) { const auto onDone = [this](const AsyncTask<TestParseResultPtr> &async) {