![]() |
Qt 6.x
The Qt SDK
|
#include <qthreadpool_p.h>
Static Public Member Functions | |
static QThreadPool * | qtGuiInstance () |
Returns the QThreadPool instance for Qt Gui. | |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (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) |
Friends | |
class | QThreadPoolThread |
Additional Inherited Members | |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Definition at line 111 of file qthreadpool_p.h.
QThreadPoolPrivate::QThreadPoolPrivate | ( | ) |
Definition at line 138 of file qthreadpool.cpp.
int QThreadPoolPrivate::activeThreadCount | ( | ) | const |
Definition at line 201 of file qthreadpool.cpp.
References allThreads, expiredThreads, reservedThreads, QSet< T >::size(), QList< T >::size(), and waitingThreads.
Referenced by areAllThreadsActive(), and tooManyThreadsActive().
bool QThreadPoolPrivate::areAllThreadsActive | ( | ) | const |
Definition at line 226 of file qthreadpool.cpp.
References activeThreadCount(), maxThreadCount(), and reservedThreads.
Referenced by tryStart().
void QThreadPoolPrivate::clear | ( | ) |
Definition at line 309 of file qthreadpool.cpp.
References QList< T >::isEmpty(), mutex, page, queue, QMutexLocker< Mutex >::relock(), QList< T >::takeLast(), and QMutexLocker< Mutex >::unlock().
Definition at line 188 of file qthreadpool.cpp.
References comparePriority(), QList< T >::constBegin(), QList< T >::constEnd(), QList< T >::insert(), it, page, Q_ASSERT, and queue.
Referenced by tryStart().
|
inline |
Definition at line 127 of file qthreadpool_p.h.
References qMax().
Referenced by areAllThreadsActive(), and tooManyThreadsActive().
|
static |
Returns the QThreadPool instance for Qt Gui.
Definition at line 481 of file qthreadpool.cpp.
References QCoreApplication::closingDown().
Referenced by QCoreApplication::~QCoreApplication(), QImage::applyColorTransform(), convert_generic(), convert_generic_inplace(), convert_generic_inplace_over_rgb64(), convert_generic_over_rgb64(), and multithread_pixels_function().
void QThreadPoolPrivate::reset | ( | ) |
Helper function only to be called from waitForDone(int)
Deletes all current threads.
Definition at line 263 of file qthreadpool.cpp.
References allThreads, QList< T >::clear(), expiredThreads, QMutex::lock(), mutex, QMutex::unlock(), and waitingThreads.
Referenced by waitForDone().
Definition at line 241 of file qthreadpool.cpp.
References activeThreads, allThreads, QSet< T >::contains(), QSet< T >::insert(), QString::isEmpty(), objectName, Q_ASSERT, and threadPriority.
Referenced by tryStart().
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 370 of file qthreadpool.cpp.
References QRunnable::autoDelete(), and QRunnable::run().
bool QThreadPoolPrivate::tooManyThreadsActive | ( | ) | const |
Definition at line 232 of file qthreadpool.cpp.
References activeThreadCount(), maxThreadCount(), and reservedThreads.
Referenced by QThreadPoolThread::run().
bool QThreadPoolPrivate::tryStart | ( | QRunnable * | task | ) |
Definition at line 141 of file qthreadpool.cpp.
References activeThreads, allThreads, areAllThreadsActive(), QQueue< T >::dequeue(), enqueueTask(), expiredThreads, QSet< T >::isEmpty(), QList< T >::isEmpty(), QThread::isFinished(), Q_ASSERT, QThreadPoolThread::runnable, QThread::start(), startThread(), QList< T >::takeFirst(), task, threadPriority, QThread::wait(), and waitingThreads.
Referenced by tryToStartMoreThreads().
void QThreadPoolPrivate::tryToStartMoreThreads | ( | ) |
Definition at line 209 of file qthreadpool.cpp.
References QList< T >::first(), QByteArray::first(), QList< T >::isEmpty(), page, queue, QList< T >::removeFirst(), and tryStart().
bool QThreadPoolPrivate::waitForDone | ( | const QDeadlineTimer & | timer | ) |
Helper function only to be called from waitForDone(int)
Definition at line 288 of file qthreadpool.cpp.
References activeThreads, QList< T >::isEmpty(), mutex, noActiveThreads, queue, timer, and QWaitCondition::wait().
bool QThreadPoolPrivate::waitForDone | ( | int | msecs | ) |
Definition at line 296 of file qthreadpool.cpp.
References mutex, reset(), timer, and waitForDone().
Referenced by waitForDone().
|
friend |
Definition at line 114 of file qthreadpool_p.h.
int QThreadPoolPrivate::activeThreads = 0 |
Definition at line 150 of file qthreadpool_p.h.
Referenced by QThreadPoolThread::registerThreadInactive(), QThreadPoolThread::run(), startThread(), tryStart(), and waitForDone().
QSet<QThreadPoolThread *> QThreadPoolPrivate::allThreads |
Definition at line 140 of file qthreadpool_p.h.
Referenced by activeThreadCount(), reset(), QThreadPoolThread::run(), startThread(), and tryStart().
QQueue<QThreadPoolThread *> QThreadPoolPrivate::expiredThreads |
Definition at line 142 of file qthreadpool_p.h.
Referenced by activeThreadCount(), reset(), QThreadPoolThread::run(), and tryStart().
int QThreadPoolPrivate::expiryTimeout = 30000 |
Definition at line 147 of file qthreadpool_p.h.
Referenced by QThreadPoolThread::run().
|
mutable |
Definition at line 139 of file qthreadpool_p.h.
Referenced by clear(), reset(), QThreadPoolThread::run(), waitForDone(), and waitForDone().
QWaitCondition QThreadPoolPrivate::noActiveThreads |
Definition at line 144 of file qthreadpool_p.h.
Referenced by QThreadPoolThread::registerThreadInactive(), and waitForDone().
QString QThreadPoolPrivate::objectName |
Definition at line 145 of file qthreadpool_p.h.
Referenced by startThread().
Definition at line 143 of file qthreadpool_p.h.
Referenced by clear(), enqueueTask(), QThreadPoolThread::run(), tryToStartMoreThreads(), and waitForDone().
int QThreadPoolPrivate::requestedMaxThreadCount = QThread::idealThreadCount() |
Definition at line 148 of file qthreadpool_p.h.
int QThreadPoolPrivate::reservedThreads = 0 |
Definition at line 149 of file qthreadpool_p.h.
Referenced by activeThreadCount(), areAllThreadsActive(), and tooManyThreadsActive().
uint QThreadPoolPrivate::stackSize = 0 |
Definition at line 151 of file qthreadpool_p.h.
Referenced by QThreadPoolThread::QThreadPoolThread().
QThread::Priority QThreadPoolPrivate::threadPriority = QThread::InheritPriority |
Definition at line 152 of file qthreadpool_p.h.
Referenced by startThread(), and tryStart().
QQueue<QThreadPoolThread *> QThreadPoolPrivate::waitingThreads |
Definition at line 141 of file qthreadpool_p.h.
Referenced by activeThreadCount(), reset(), QThreadPoolThread::run(), and tryStart().