*/
QThreadPool::~QThreadPool()
{
- d_func()->waitForDone();
- d_func()->reset();
+ waitForDone();
}
/*!
}
/*!
- Waits for each thread to exit and removes all threads from the thread pool.
-*/
-void QThreadPool::waitForDone()
-{
- Q_D(QThreadPool);
- d->waitForDone();
- d->reset();
-}
-
-/*!
- \overload waitForDone()
- \since 4.8
-
Waits up to \a msecs milliseconds for all threads to exit and removes all
threads from the thread pool. Returns true if all threads were removed;
- otherwise it returns false.
+ otherwise it returns false. If \a msecs is -1 (the default), the timeout
+ is ignored (waits for the last thread to exit).
*/
bool QThreadPool::waitForDone(int msecs)
{
void startThread(QRunnable *runnable = 0);
void reset();
- bool waitForDone(int msecs = -1);
+ bool waitForDone(int msecs);
void stealRunnable(QRunnable *);
mutable QMutex mutex;