diff options
author | David Faure <david.faure@kdab.com> | 2013-03-15 19:47:46 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-22 12:12:36 +0100 |
commit | bf3a5ccef13d568662f027be62280aba1f73bada (patch) | |
tree | ffb684ec1c5be91bfe7fefc1be589147a4502801 /src/corelib/thread | |
parent | 49d7e71f77f899c05e4b5187e8834dfcbddf4505 (diff) |
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>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qthread_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 2cf988260f..8e9eb1035a 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -231,6 +231,12 @@ public: void ref(); void deref(); + bool canWaitLocked() + { + QMutexLocker locker(&postEventList.mutex); + return canWait; + } + QThread *thread; Qt::HANDLE threadId; bool quitNow; |