aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/ftw
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-09-13 16:13:54 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-09-14 21:43:52 +0200
commitec23378d217ba16415949c557b2c77989cadd75c (patch)
treec1ec3bb04b107276feab37e5e65eb9e6a1bbf92b /src/qml/qml/ftw
parent626ce00d53ae7aa9d605b1b65a68e5aa1bd4bf14 (diff)
QQmlThread: optimize isThisThread by using currentThreadId
Change-Id: Ic8b7c08562219e375f4f9ea5bacbb269b33e2930 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/ftw')
-rw-r--r--src/qml/qml/ftw/qqmlthread.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp
index e0bc5572c3..2a22f0cf1d 100644
--- a/src/qml/qml/ftw/qqmlthread.cpp
+++ b/src/qml/qml/ftw/qqmlthread.cpp
@@ -11,6 +11,8 @@
#include <QtCore/qwaitcondition.h>
#include <QtCore/qcoreapplication.h>
+#include <QtCore/private/qthread_p.h>
+
QT_BEGIN_NAMESPACE
class QQmlThreadPrivate : public QThread
@@ -259,7 +261,7 @@ void QQmlThread::wait()
bool QQmlThread::isThisThread() const
{
- return QThread::currentThread() == d;
+ return QThread::currentThreadId() == static_cast<QThreadPrivate *>(QObjectPrivate::get(d))->threadData.loadRelaxed()->threadId.loadRelaxed();
}
QThread *QQmlThread::thread() const