summaryrefslogtreecommitdiffstats
path: root/src/corelib/concurrent/qthreadpool.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2010-04-01 09:34:10 (GMT)
committerPierre Rossi <pierre.rossi@nokia.com>2010-04-01 09:34:10 (GMT)
commit29cef8ab2783bf28955c84f6da2f2cce1490f171 (patch)
treea8ad894df6ff84f9cbbf384c1afcfd648d6502b4 /src/corelib/concurrent/qthreadpool.cpp
parent8ffd45cf6832b67960dbaa10654c4b84358fe3f9 (diff)
downloadQt-29cef8ab2783bf28955c84f6da2f2cce1490f171.zip
Qt-29cef8ab2783bf28955c84f6da2f2cce1490f171.tar.gz
Qt-29cef8ab2783bf28955c84f6da2f2cce1490f171.tar.bz2
Revert "adds a timeout option to QThreadPool::waitForDone();"
This reverts commit a0df2ac07c75882618b40657e1485dda3204880e as it induced a BC breakage.
Diffstat (limited to 'src/corelib/concurrent/qthreadpool.cpp')
-rw-r--r--src/corelib/concurrent/qthreadpool.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/concurrent/qthreadpool.cpp
index a4057f1..9e4189e 100644
--- a/src/corelib/concurrent/qthreadpool.cpp
+++ b/src/corelib/concurrent/qthreadpool.cpp
@@ -41,7 +41,6 @@
#include "qthreadpool.h"
#include "qthreadpool_p.h"
-#include "qelapsedtimer.h"
#ifndef QT_NO_THREAD
@@ -289,18 +288,11 @@ void QThreadPoolPrivate::reset()
isExiting = false;
}
-void QThreadPoolPrivate::waitForDone(int msecs)
+void QThreadPoolPrivate::waitForDone()
{
QMutexLocker locker(&mutex);
- if (msecs < 0){
- while (!(queue.isEmpty() && activeThreads == 0))
- noActiveThreads.wait(locker.mutex());
- } else {
- QElapsedTimer timer;
- timer.start();
- while (!(queue.isEmpty() && activeThreads == 0) && (timer.elapsed() < msecs))
- noActiveThreads.wait(locker.mutex(), msecs - timer.elapsed());
- }
+ while (!(queue.isEmpty() && activeThreads == 0))
+ noActiveThreads.wait(locker.mutex());
}
/*! \internal
@@ -618,10 +610,10 @@ void QThreadPool::releaseThread()
/*!
Waits for each thread to exit and removes all threads from the thread pool.
*/
-void QThreadPool::waitForDone(int msecs)
+void QThreadPool::waitForDone()
{
Q_D(QThreadPool);
- d->waitForDone(msecs);
+ d->waitForDone();
d->reset();
}