summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2018-08-30 18:02:45 +1000
committerLorn Potter <lorn.potter@gmail.com>2019-03-04 19:25:13 +0000
commitceb0e377b11c6d1b5cf3961901c8bb72d2020d91 (patch)
tree6b75a17c1caaa4a5ffc90ba8c8f37ca2328d761d /src/corelib/thread
parentef5aefb062bf8cbfb764f2deba731d3d64069099 (diff)
nothread: add exit function to QThread stub
This allows QtDeclarative examples to build. Change-Id: Icd20304f76f8ba15c94eaf01b9fcd7b151b16146 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 05bc064005..b023ae9ed2 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -818,6 +818,16 @@ void QThread::quit()
}
+void QThread::exit(int returnCode)
+{
+ Q_D(QThread);
+ d->data->quitNow = true;
+ for (int i = 0; i < d->data->eventLoops.size(); ++i) {
+ QEventLoop *eventLoop = d->data->eventLoops.at(i);
+ eventLoop->exit(returnCode);
+ }
+}
+
bool QThread::wait(unsigned long time)
{
Q_UNUSED(time);