summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-10 22:35:31 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-10 22:35:31 (GMT)
commitca13ba801144763b1ca7c39b2ef8594de94e2d3e (patch)
tree7600e31df6ce715a5bc28c0c97983bac9484c7cb /src/corelib/thread/qthread.cpp
parentab38731fe5dcfaa1a7a70bc290a8856b5b01524d (diff)
parentec20a6da3edea3031f1705c3b13e24dc2c7c6de5 (diff)
downloadQt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.zip
Qt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.tar.gz
Qt-ca13ba801144763b1ca7c39b2ef8594de94e2d3e.tar.bz2
Merge remote-tracking branch 'origin/4.7' into HEAD
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r--src/corelib/thread/qthread.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index f4bfa5d..8223cff 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;
@@ -506,10 +509,12 @@ int QThread::exec()
Note that unlike the C library function of the same name, this
function \e does return to the caller -- it is event processing
- that stops.
-
- This function does nothing if the thread does not have an event
- loop.
+ that stops.
+
+ No QEventLoops will be started anymore in this thread until
+ QThread::exec() has been called again. If the eventloop in QThread::exec()
+ is not running then the next call to QThread::exec() will also return
+ immediately.
\sa quit() QEventLoop
*/