19#include "QtCore/qmutex.h"
20#include "QtCore/qthread.h"
21#include "QtCore/qwaitcondition.h"
22#include "QtCore/qthreadpool.h"
23#include "QtCore/qset.h"
24#include "QtCore/qqueue.h"
25#include "private/qobject_p.h"
51 m_entries[m_lastIndex] = runnable;
56 while (!
isFinished() && m_entries[m_firstIndex] ==
nullptr) {
64 QRunnable *runnable = m_entries[m_firstIndex];
76 m_entries[m_firstIndex] =
nullptr;
88 for (
int i = m_firstIndex;
i <= m_lastIndex;
i++) {
89 if (m_entries[
i] == runnable) {
90 m_entries[
i] =
nullptr;
91 if (
i == m_firstIndex) {
105 int m_firstIndex = 0;
106 int m_lastIndex = -1;
121 int activeThreadCount() const;
123 void tryToStartMoreThreads();
124 bool areAllThreadsActive() const;
125 bool tooManyThreadsActive() const;
127 int maxThreadCount()
const
128 {
return qMax(requestedMaxThreadCount, 1); }
129 void startThread(
QRunnable *runnable =
nullptr);
131 bool waitForDone(
int msecs);
134 void stealAndRunRunnable(
QRunnable *runnable);
147 int expiryTimeout = 30000;
149 int reservedThreads = 0;
150 int activeThreads = 0;
\macro QT_RESTRICTED_CAST_FROM_ASCII
void deletePageIfFinished(QueuePage *page)
QList< QueuePage * > queue
QWaitCondition noActiveThreads
QQueue< QThreadPoolThread * > expiredThreads
QSet< QThreadPoolThread * > allThreads
QQueue< QThreadPoolThread * > waitingThreads
static int idealThreadCount() noexcept
QueuePage(QRunnable *runnable, int pri)
bool tryTake(QRunnable *runnable)
void push(QRunnable *runnable)
Combined button and popup list for selecting options.
constexpr const T & qMax(const T &a, const T &b)
#define QT_REQUIRE_CONFIG(feature)