6#if !defined(QT_NO_CONCURRENT) || defined(Q_QDOC)
58 int localCount =
count.loadRelaxed();
60 if (
count.testAndSetOrdered(localCount, localCount -1))
63 if (
count.testAndSetOrdered(localCount, localCount + 1))
73 int localCount =
count.loadRelaxed();
74 if (localCount == -1) {
75 if (
count.testAndSetOrdered(-1, 0)) {
79 }
else if (localCount < 0) {
80 if (
count.testAndSetOrdered(localCount, localCount + 1))
81 return qAbs(localCount + 1);
83 if (
count.testAndSetOrdered(localCount, localCount - 1))
84 return localCount - 1;
94 int localCount =
count.loadRelaxed();
99 if (
count.testAndSetOrdered(localCount, -localCount)) {
109 return count.loadRelaxed();
117 int localCount =
count.loadRelaxed();
118 if (
qAbs(localCount) == 1) {
120 }
else if (localCount < 0) {
121 if (
count.testAndSetOrdered(localCount, localCount + 1))
124 if (
count.testAndSetOrdered(localCount, localCount - 1))
149 startThreadInternal();
195bool ThreadEngineBase::startThreadInternal()
208void ThreadEngineBase::startThreads()
214void ThreadEngineBase::threadExit()
219 if (lastThread && asynchronous)
226bool ThreadEngineBase::threadThrottleExit()
240#ifndef QT_NO_EXCEPTIONS
248 if (threadThrottleExit()) {
259#ifndef QT_NO_EXCEPTIONS
269#ifndef QT_NO_EXCEPTIONS
271void ThreadEngineBase::handleException(
const QException &exception)
bool isSuspending() const
void setProgressValue(int progressValue)
void setProgressRange(int minimum, int maximum)
void reportException(const QException &e)
void reportSuspended() const
void setAutoDelete(bool autoDelete)
Enables auto-deletion if autoDelete is true; otherwise auto-deletion is disabled.
void acquire(int n=1)
Tries to acquire n resources guarded by the semaphore.
void release(int n=1)
Releases n resources guarded by the semaphore.
bool tryStart(QRunnable *runnable)
Attempts to reserve a thread to run runnable.
ThreadEngineBarrier barrier
void setProgressValue(int progress)
void setProgressRange(int minimum, int maximum)
virtual ThreadFunctionResult threadFunction()
virtual void asynchronousFinish()=0
virtual ~ThreadEngineBase()
bool isProgressReportingEnabled()
virtual bool shouldStartThread()
QtPrivate::ExceptionStore exceptionStore
void reportIfSuspensionDone() const
void run() override
Implement this pure virtual function in your subclass.
void acquireBarrierSemaphore()
ThreadEngineBase(QThreadPool *pool)
QFutureInterfaceBase * futureInterface
void startSingleThreaded()
void setException(const QException &e)
bool hasException() const
Combined button and popup list for selecting options.
constexpr T qAbs(const T &t)
GLenum GLenum GLsizei count
QT_BEGIN_NAMESPACE Q_ALWAYS_INLINE void qYieldCpu(void) Q_DECL_NOEXCEPT