summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2019-07-05 09:17:35 +0200
committerPaul Lemire <paul.lemire@kdab.com>2019-08-07 08:59:43 +0000
commitda2c94c13c163922467e6d88e19442fc12aea523 (patch)
treec84cd02890b26e720e08e5a9ac8f366b9db4f39a
parent260af7338d3a4216dbac292a4fd9112ad7512f44 (diff)
Fix QThreadPooler
Handle Manual Drive mode / Scene3D changes jobs stats Change-Id: Iadd7dd64580ce88145b264df5adcfc8bcb36b66a Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r--src/core/jobs/qthreadpooler.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp
index ca123ddad..0e9af58dd 100644
--- a/src/core/jobs/qthreadpooler.cpp
+++ b/src/core/jobs/qthreadpooler.cpp
@@ -212,7 +212,7 @@ void QThreadPooler::addJobLogStatsEntry(JobRunStats &stats)
jobStatsCached.localData()->push_back(stats);
}
-// Called after jobs have been executed (AspectThread QAspectJobManager::enqueueJobs)
+// Called after jobs have been executed (MainThread QAspectJobManager::enqueueJobs)
void QThreadPooler::writeFrameJobLogStats()
{
static QScopedPointer<QFile> traceFile;
@@ -268,7 +268,7 @@ void QThreadPooler::writeFrameJobLogStats()
++frameId;
}
-// Called from Submission thread
+// Called from Submission thread (which can be main thread in Manual drive mode)
void QThreadPooler::addSubmissionLogStatsEntry(JobRunStats &stats)
{
QMutexLocker lock(&localStoragesMutex);
@@ -276,6 +276,12 @@ void QThreadPooler::addSubmissionLogStatsEntry(JobRunStats &stats)
submissionStorage = new QVector<JobRunStats>;
jobStatsCached.setLocalData(submissionStorage);
}
+
+ // Handle the case where submission thread is also the main thread (Scene/Manual drive modes with no RenderThread)
+ if (submissionStorage == nullptr && jobStatsCached.hasLocalData())
+ submissionStorage = new QVector<JobRunStats>;
+
+ // When having no submission thread this can be null
submissionStorage->push_back(stats);
}