summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_win.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2015-02-06 09:50:29 (GMT)
committerAndy Shaw <andy.shaw@digia.com>2015-02-08 11:48:28 (GMT)
commit97b85f4f4e7fc14ff47cd92e4525f7a56864bff4 (patch)
tree48cdc7e92aa52adafc76a963792fffbb5ae33887 /src/corelib/thread/qthread_win.cpp
parent6d5a2db97d6f19f4ccc446473adc40a922e1a7ea (diff)
downloadQt-97b85f4f4e7fc14ff47cd92e4525f7a56864bff4.zip
Qt-97b85f4f4e7fc14ff47cd92e4525f7a56864bff4.tar.gz
Qt-97b85f4f4e7fc14ff47cd92e4525f7a56864bff4.tar.bz2
QThread: fix race when setting the eventDispatcher
Use QMutexLocker to make this thread-safe. Task-number: QTBUG-29452 (cherry picked and adapted from qtbase/f4609b202208fe592d24c7ae3b4a48ee83045497) Change-Id: I5caf71d9a5dc6e3d655eac84426a0c5592772235 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Diffstat (limited to 'src/corelib/thread/qthread_win.cpp')
-rw-r--r--src/corelib/thread/qthread_win.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 4ebae9e..01ddf02 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -318,7 +318,9 @@ void qt_set_thread_name(HANDLE threadId, LPCSTR threadName)
void QThreadPrivate::createEventDispatcher(QThreadData *data)
{
+ QMutexLocker l(&data->postEventList.mutex);
data->eventDispatcher = new QEventDispatcherWin32;
+ l.unlock();
data->eventDispatcher->startingUp();
}