summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_unix.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2010-04-14 12:55:23 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2010-04-14 12:57:29 (GMT)
commit5c42726aac64dd270dc5f7dd87ad925db2ee46cf (patch)
tree4131389aee59af63c0a5a4ef5bc3ca6178b8f277 /src/corelib/thread/qthread_unix.cpp
parente5d1bb8e20cfa322807198359efc05c18938b2f3 (diff)
downloadQt-5c42726aac64dd270dc5f7dd87ad925db2ee46cf.zip
Qt-5c42726aac64dd270dc5f7dd87ad925db2ee46cf.tar.gz
Qt-5c42726aac64dd270dc5f7dd87ad925db2ee46cf.tar.bz2
Fix a race where QThread::exit() is "lost" when called after start()
This reverts commit 9aa4538b219ed759a47e8d1f93c2797bf07b5e2f and fixes the bug in a different way. If the QThreadData::quitNow flag is set when entering QThread::exec(), allow QEventLoop::exec() to bail out and reset quitNow after QEventLoop::exec() has returned (not before). Task-number: QTBUG-1184 Reviewed-by: olivier
Diffstat (limited to 'src/corelib/thread/qthread_unix.cpp')
-rw-r--r--src/corelib/thread/qthread_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 6b34b5f..bd31d9c 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -253,7 +253,6 @@ void *QThreadPrivate::start(void *arg)
pthread_setspecific(current_thread_data_key, data);
data->ref();
- data->quitNow = false;
// ### TODO: allow the user to create a custom event dispatcher
createEventDispatcher(data);
@@ -495,6 +494,7 @@ void QThread::start(Priority priority)
d->running = true;
d->finished = false;
d->terminated = false;
+ d->data->quitNow = false;
pthread_attr_t attr;
pthread_attr_init(&attr);