Skip to content

Commit

Permalink
no-thread: add QThread::isMainThread() definition
Browse files Browse the repository at this point in the history
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 59039f4)
Reviewed-by: Fabian Kosmale <[email protected]>
  • Loading branch information
Morten Sørvig authored and jaheikk committed Jan 23, 2025
1 parent 7affce8 commit f1136de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/corelib/thread/qthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f1136de

Please sign in to comment.