summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-02 08:27:53 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-02 08:50:39 (GMT)
commit9fa392cdb528db0bb5073892484c809e99ae27b3 (patch)
treed28d351611fdd15142829fc51be6a02b35d43759 /src/corelib/thread/qthread.cpp
parent95b17fbe91eb3b1b0fcac92d8a8934769e4cd847 (diff)
downloadQt-9fa392cdb528db0bb5073892484c809e99ae27b3.zip
Qt-9fa392cdb528db0bb5073892484c809e99ae27b3.tar.gz
Qt-9fa392cdb528db0bb5073892484c809e99ae27b3.tar.bz2
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/qthread.cpp')
-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 f4bfa5d..f368192 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;