summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2013-03-15 18:47:46 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-23 08:24:01 (GMT)
commit815d7f0ff36aa656ecfbf6a6d69fc9453d72e598 (patch)
treec32c8297422c1171f419aac136edd6d8969ecdb5 /src/corelib/thread
parentea1521a490e6e6c2830eb8e072e80c554a91a439 (diff)
downloadQt-815d7f0ff36aa656ecfbf6a6d69fc9453d72e598.zip
Qt-815d7f0ff36aa656ecfbf6a6d69fc9453d72e598.tar.gz
Qt-815d7f0ff36aa656ecfbf6a6d69fc9453d72e598.tar.bz2
QThreadDataPrivate: fix data race on canWait boolean.
postEvent() accesses it with the postEventList mutex locked, but processEvent() was checking it without any mutex locked. Change-Id: I31bbb50f7a1c337067b8e3de16ee7cd11400b517 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/bf3a5ccef13d568662f027be62280aba1f73bada) Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 766c62a..49cb80e 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -222,6 +222,12 @@ public:
void ref();
void deref();
+ bool canWaitLocked()
+ {
+ QMutexLocker locker(&postEventList.mutex);
+ return canWait;
+ }
+
QThread *thread;
Qt::HANDLE threadId;
bool quitNow;