no-thread: add QThread::isMainThread() definition

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ø <tor.arne.vestbo@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 59039f42d863815556a9de05a452f8802c727582)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Morten Sørvig 2024-11-14 12:02:40 +01:00 committed by Jani Heikkinen
parent 7affce8752
commit f1136de666

View File

@ -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;