summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-02 09:27:53 +0100
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-02 09:50:39 +0100
commit9fa392cdb528db0bb5073892484c809e99ae27b3 (patch)
treed28d351611fdd15142829fc51be6a02b35d43759 /src/corelib/thread
parent95b17fbe91eb3b1b0fcac92d8a8934769e4cd847 (diff)
Revert "Restore Qt 4.6 behaviour: exec() always enters the event loop."
This reverts commit 2e72a8b19ea6c674fb4777860dac50faa5d387e6. The behavour in Qt 4.6 was wrong. And even if it was not documented, it is too late to change the behaviour back at this point. The tests for QEventLoop and QCoreApplication have not been reverted Reviewed-by: Brad
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index f4bfa5d2eb..f368192eff 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -482,7 +482,10 @@ int QThread::exec()
Q_D(QThread);
QMutexLocker locker(&d->mutex);
d->data->quitNow = false;
- d->exited = false;
+ if (d->exited) {
+ d->exited = false;
+ return d->returnCode;
+ }
locker.unlock();
QEventLoop eventLoop;