From f1136de66638060b8a1ab9bc0cdf1a91dcb5ec01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Thu, 14 Nov 2024 12:02:40 +0100 Subject: [PATCH] no-thread: add QThread::isMainThread() definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this configuration there is one thread (as far as Qt is concerned), and that is the main thread. Pick-to: 6.8 Change-Id: I6817961a0f95f2e8b1bb3ea120154d954f1eaf0f Reviewed-by: Tor Arne Vestbø Reviewed-by: Even Oscar Andersen (cherry picked from commit 59039f42d863815556a9de05a452f8802c727582) Reviewed-by: Fabian Kosmale --- src/corelib/thread/qthread.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 0c95a58d895..e5006cbb1d5 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -1010,6 +1010,11 @@ QThread *QThread::currentThread() return QThreadData::current()->thread.loadAcquire(); } +bool QThread::isMainThread() noexcept +{ + return true; +} + bool QThread::isCurrentThread() const noexcept { return true;