diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-01 12:14:15 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-01 12:14:15 (GMT) |
commit | 5fb8d729ddf56003af326ba4c9dbff56b57ed105 (patch) | |
tree | a8ad894df6ff84f9cbbf384c1afcfd648d6502b4 /src | |
parent | 8ffd45cf6832b67960dbaa10654c4b84358fe3f9 (diff) | |
parent | 29cef8ab2783bf28955c84f6da2f2cce1490f171 (diff) | |
download | Qt-5fb8d729ddf56003af326ba4c9dbff56b57ed105.zip Qt-5fb8d729ddf56003af326ba4c9dbff56b57ed105.tar.gz Qt-5fb8d729ddf56003af326ba4c9dbff56b57ed105.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Revert "adds a timeout option to QThreadPool::waitForDone();"
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/concurrent/qthreadpool.cpp | 18 | ||||
-rw-r--r-- | src/corelib/concurrent/qthreadpool.h | 2 | ||||
-rw-r--r-- | src/corelib/concurrent/qthreadpool_p.h | 2 |
3 files changed, 7 insertions, 15 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(); } diff --git a/src/corelib/concurrent/qthreadpool.h b/src/corelib/concurrent/qthreadpool.h index 9895c41..cc1e059 100644 --- a/src/corelib/concurrent/qthreadpool.h +++ b/src/corelib/concurrent/qthreadpool.h @@ -84,7 +84,7 @@ public: void reserveThread(); void releaseThread(); - void waitForDone(int msecs = -1); + void waitForDone(); }; QT_END_NAMESPACE diff --git a/src/corelib/concurrent/qthreadpool_p.h b/src/corelib/concurrent/qthreadpool_p.h index 1a0e4ab..8a2cf98 100644 --- a/src/corelib/concurrent/qthreadpool_p.h +++ b/src/corelib/concurrent/qthreadpool_p.h @@ -82,7 +82,7 @@ public: void startThread(QRunnable *runnable = 0); void reset(); - void waitForDone(int msecs = -1); + void waitForDone(); bool startFrontRunnable(); void stealRunnable(QRunnable *); |