summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <[email protected]>2024-11-14 12:02:40 +0100
committerJani Heikkinen <[email protected]>2025-01-23 08:44:50 +0000
commitf1136de66638060b8a1ab9bc0cdf1a91dcb5ec01 (patch)
tree4bf6762ebd67b816baf7be5e00724c5a80f998bc
parent7affce87527051ba2fd2d4f3a2332485a4b5d949 (diff)
no-thread: add QThread::isMainThread() definitionv6.8.26.8.2
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ø <[email protected]> Reviewed-by: Even Oscar Andersen <[email protected]> (cherry picked from commit 59039f42d863815556a9de05a452f8802c727582) Reviewed-by: Fabian Kosmale <[email protected]>
-rw-r--r--src/corelib/thread/qthread.cpp5
1 files changed, 5 insertions, 0 deletions
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;