Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QThreadData Class Reference

#include <qthread_p.h>

+ Collaboration diagram for QThreadData:

Public Member Functions

 QThreadData (int initialRefCount=1)
 
 ~QThreadData ()
 
void ref ()
 
void deref ()
 
bool hasEventDispatcher () const
 
QAbstractEventDispatchercreateEventDispatcher ()
 
QAbstractEventDispatcherensureEventDispatcher ()
 
bool canWaitLocked ()
 

Static Public Member Functions

static Q_AUTOTEST_EXPORT QThreadDatacurrent (bool createIfNecessary=true)
 
static void clearCurrentThreadData ()
 
static QThreadDataget2 (QThread *thread)
 

Public Attributes

int loopLevel
 
int scopeLevel
 
QStack< QEventLoop * > eventLoops
 
QPostEventList postEventList
 
QAtomicPointer< QThreadthread
 
QAtomicPointer< voidthreadId
 
QAtomicPointer< QAbstractEventDispatchereventDispatcher
 
QList< void * > tls
 
bool quitNow
 
bool canWait
 
bool isAdopted
 
bool requiresCoreApplication
 

Detailed Description

Definition at line 282 of file qthread_p.h.

Constructor & Destructor Documentation

◆ QThreadData()

QThreadData::QThreadData ( int  initialRefCount = 1)

Definition at line 48 of file qthread.cpp.

◆ ~QThreadData()

QThreadData::~QThreadData ( )

Definition at line 56 of file qthread.cpp.

References QList< T >::at(), clearCurrentThreadData(), QPostEvent::event, i, QBasicAtomicPointer< X >::loadAcquire(), QBasicAtomicInteger< T >::loadRelaxed(), postEventList, Q_ASSERT, QPostEvent::receiver, QList< T >::size(), QBasicAtomicPointer< X >::storeRelease(), QCoreApplicationPrivate::theMainThread, and thread.

+ Here is the call graph for this function:

Member Function Documentation

◆ canWaitLocked()

bool QThreadData::canWaitLocked ( )
inline

Definition at line 307 of file qthread_p.h.

References canWait, QPostEventList::mutex, and postEventList.

◆ clearCurrentThreadData()

void QThreadData::clearCurrentThreadData ( )
static

Definition at line 1019 of file qthread.cpp.

Referenced by ~QThreadData().

+ Here is the caller graph for this function:

◆ createEventDispatcher()

QAbstractEventDispatcher * QThreadData::createEventDispatcher ( )

Definition at line 112 of file qthread.cpp.

References QThreadPrivate::createEventDispatcher(), eventDispatcher, and QBasicAtomicPointer< X >::storeRelease().

Referenced by ensureEventDispatcher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ current()

QThreadData * QThreadData::current ( bool  createIfNecessary = true)
static

◆ deref()

void QThreadData::deref ( )

Definition at line 104 of file qthread.cpp.

References QBasicAtomicInteger< T >::deref().

Referenced by QObject::moveToThread(), and QObjectPrivate::setThreadData_helper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensureEventDispatcher()

QAbstractEventDispatcher * QThreadData::ensureEventDispatcher ( )
inline

Definition at line 299 of file qthread_p.h.

References createEventDispatcher(), eventDispatcher, QBasicAtomicPointer< X >::loadRelaxed(), and Q_LIKELY.

Referenced by QWindowsRemovableDriveListener::addPath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get2()

static QThreadData * QThreadData::get2 ( QThread thread)
inlinestatic

Definition at line 290 of file qthread_p.h.

References Q_ASSERT_X, and thread.

Referenced by QCoreApplicationData::~QCoreApplicationData(), QtWaylandClient::QWaylandWindow::doApplyConfigure(), QAbstractEventDispatcher::instance(), QMetaMethodInvoker::invokeImpl(), QObject::moveToThread(), and QtWaylandClient::QWaylandWindow::setCanResize().

+ Here is the caller graph for this function:

◆ hasEventDispatcher()

bool QThreadData::hasEventDispatcher ( ) const
inline

Definition at line 296 of file qthread_p.h.

References eventDispatcher, and QBasicAtomicPointer< X >::loadRelaxed().

Referenced by QObjectPrivate::setThreadData_helper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ref()

void QThreadData::ref ( )

Definition at line 96 of file qthread.cpp.

References QBasicAtomicInteger< T >::loadRelaxed(), Q_ASSERT, QBasicAtomicInteger< T >::ref(), and void.

Referenced by QMetaObjectPrivate::connect(), QObjectPrivate::connectImpl(), QObject::moveToThread(), and QObjectPrivate::setThreadData_helper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ canWait

bool QThreadData::canWait

Definition at line 328 of file qthread_p.h.

Referenced by canWaitLocked(), and QObjectPrivate::setThreadData_helper().

◆ eventDispatcher

◆ eventLoops

QStack<QEventLoop *> QThreadData::eventLoops

Definition at line 320 of file qthread_p.h.

Referenced by QCoreApplication::exec().

◆ isAdopted

bool QThreadData::isAdopted

Definition at line 329 of file qthread_p.h.

◆ loopLevel

int QThreadData::loopLevel

Definition at line 317 of file qthread_p.h.

◆ postEventList

◆ quitNow

bool QThreadData::quitNow

Definition at line 327 of file qthread_p.h.

Referenced by QCoreApplication::exec(), and QCoreApplicationPrivate::execCleanup().

◆ requiresCoreApplication

bool QThreadData::requiresCoreApplication

Definition at line 330 of file qthread_p.h.

◆ scopeLevel

int QThreadData::scopeLevel

◆ thread

◆ threadId

◆ tls

QList<void *> QThreadData::tls

Definition at line 325 of file qthread_p.h.


The documentation for this class was generated from the following files: