Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QThreadPoolPrivate Class Reference

#include <qthreadpool_p.h>

+ Inheritance diagram for QThreadPoolPrivate:
+ Collaboration diagram for QThreadPoolPrivate:

Public Member Functions

 QThreadPoolPrivate ()
 
bool tryStart (QRunnable *task)
 
void enqueueTask (QRunnable *task, int priority=0)
 
int activeThreadCount () const
 
void tryToStartMoreThreads ()
 
bool areAllThreadsActive () const
 
bool tooManyThreadsActive () const
 
int maxThreadCount () const
 
void startThread (QRunnable *runnable=nullptr)
 
void reset ()
 
bool waitForDone (const QDeadlineTimer &timer)
 
void clear ()
 
void stealAndRunRunnable (QRunnable *runnable)
 
void deletePageIfFinished (QueuePage *page)
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static QThreadPoolqtGuiInstance ()
 Returns the QThreadPool instance for Qt Gui.
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QMutex mutex
 
QSet< QThreadPoolThread * > allThreads
 
QQueue< QThreadPoolThread * > waitingThreads
 
QQueue< QThreadPoolThread * > expiredThreads
 
QList< QueuePage * > queue
 
QWaitCondition noActiveThreads
 
QString objectName
 
std::chrono::duration< int, std::milli > expiryTimeout = std::chrono::seconds(30)
 
int requestedMaxThreadCount = QThread::idealThreadCount()
 
int reservedThreads = 0
 
int activeThreads = 0
 
uint stackSize = 0
 
QThread::Priority threadPriority = QThread::InheritPriority
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Friends

class QThreadPoolThread
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(*) StaticMetaCallFunction(QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Detailed Description

Definition at line 111 of file qthreadpool_p.h.

Constructor & Destructor Documentation

◆ QThreadPoolPrivate()

QThreadPoolPrivate::QThreadPoolPrivate ( )

Definition at line 142 of file qthreadpool.cpp.

Member Function Documentation

◆ activeThreadCount()

int QThreadPoolPrivate::activeThreadCount ( ) const

Definition at line 205 of file qthreadpool.cpp.

◆ areAllThreadsActive()

bool QThreadPoolPrivate::areAllThreadsActive ( ) const

Definition at line 230 of file qthreadpool.cpp.

◆ clear()

void QThreadPoolPrivate::clear ( )

Definition at line 308 of file qthreadpool.cpp.

◆ deletePageIfFinished()

void QThreadPoolPrivate::deletePageIfFinished ( QueuePage * page)

◆ enqueueTask()

void QThreadPoolPrivate::enqueueTask ( QRunnable * task,
int priority = 0 )

Definition at line 192 of file qthreadpool.cpp.

◆ maxThreadCount()

int QThreadPoolPrivate::maxThreadCount ( ) const
inline

Definition at line 127 of file qthreadpool_p.h.

◆ qtGuiInstance()

QThreadPool * QThreadPoolPrivate::qtGuiInstance ( )
static

Returns the QThreadPool instance for Qt Gui.

Definition at line 480 of file qthreadpool.cpp.

◆ reset()

void QThreadPoolPrivate::reset ( )

Helper function only to be called from waitForDone()

Deletes all current threads.

Definition at line 267 of file qthreadpool.cpp.

◆ startThread()

void QThreadPoolPrivate::startThread ( QRunnable * runnable = nullptr)

Definition at line 245 of file qthreadpool.cpp.

◆ stealAndRunRunnable()

void QThreadPoolPrivate::stealAndRunRunnable ( QRunnable * runnable)

Searches for runnable in the queue, removes it from the queue and runs it if found. This function does not return until the runnable has completed.

Definition at line 369 of file qthreadpool.cpp.

◆ tooManyThreadsActive()

bool QThreadPoolPrivate::tooManyThreadsActive ( ) const

Definition at line 236 of file qthreadpool.cpp.

◆ tryStart()

bool QThreadPoolPrivate::tryStart ( QRunnable * task)

Definition at line 145 of file qthreadpool.cpp.

◆ tryToStartMoreThreads()

void QThreadPoolPrivate::tryToStartMoreThreads ( )

Definition at line 213 of file qthreadpool.cpp.

◆ waitForDone()

bool QThreadPoolPrivate::waitForDone ( const QDeadlineTimer & timer)

Helper function only to be called from the public waitForDone()

Definition at line 292 of file qthreadpool.cpp.

Friends And Related Symbol Documentation

◆ QThreadPoolThread

friend class QThreadPoolThread
friend

Definition at line 114 of file qthreadpool_p.h.

Member Data Documentation

◆ activeThreads

int QThreadPoolPrivate::activeThreads = 0

Definition at line 149 of file qthreadpool_p.h.

◆ allThreads

QSet<QThreadPoolThread *> QThreadPoolPrivate::allThreads

Definition at line 139 of file qthreadpool_p.h.

◆ expiredThreads

QQueue<QThreadPoolThread *> QThreadPoolPrivate::expiredThreads

Definition at line 141 of file qthreadpool_p.h.

◆ expiryTimeout

std::chrono::duration<int, std::milli> QThreadPoolPrivate::expiryTimeout = std::chrono::seconds(30)

Definition at line 146 of file qthreadpool_p.h.

◆ mutex

QMutex QThreadPoolPrivate::mutex
mutable

Definition at line 138 of file qthreadpool_p.h.

◆ noActiveThreads

QWaitCondition QThreadPoolPrivate::noActiveThreads

Definition at line 143 of file qthreadpool_p.h.

◆ objectName

QString QThreadPoolPrivate::objectName

Definition at line 144 of file qthreadpool_p.h.

◆ queue

QList<QueuePage *> QThreadPoolPrivate::queue

Definition at line 142 of file qthreadpool_p.h.

◆ requestedMaxThreadCount

int QThreadPoolPrivate::requestedMaxThreadCount = QThread::idealThreadCount()

Definition at line 147 of file qthreadpool_p.h.

◆ reservedThreads

int QThreadPoolPrivate::reservedThreads = 0

Definition at line 148 of file qthreadpool_p.h.

◆ stackSize

uint QThreadPoolPrivate::stackSize = 0

Definition at line 150 of file qthreadpool_p.h.

◆ threadPriority

QThread::Priority QThreadPoolPrivate::threadPriority = QThread::InheritPriority

Definition at line 151 of file qthreadpool_p.h.

◆ waitingThreads

QQueue<QThreadPoolThread *> QThreadPoolPrivate::waitingThreads

Definition at line 140 of file qthreadpool_p.h.


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