diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-11 16:12:21 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-10-11 16:12:35 +0200 |
commit | d0eb444a49f6064ecb896f62276e060cd8a4b1e8 (patch) | |
tree | 34d8dd637baf665225ada73e76604531cd2c75e5 /src/corelib/thread/qthread_p.h | |
parent | da0cb32b8ee7cc4a991a59420a411898e63a660e (diff) | |
parent | 894f86709080fe8d20875b402adce679963c49c2 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ib8cfeee7d9ca15e8ad520e428b72c200827a8628
Diffstat (limited to 'src/corelib/thread/qthread_p.h')
-rw-r--r-- | src/corelib/thread/qthread_p.h | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 8c75690404..c9b98ac5c0 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -228,8 +228,6 @@ public: class QThreadData { - QAtomicInt _ref; - public: QThreadData(int initialRefCount = 1); ~QThreadData(); @@ -251,15 +249,42 @@ public: return canWait; } - QThread *thread; - Qt::HANDLE threadId; - bool quitNow; + // This class provides per-thread (by way of being a QThreadData + // member) storage for qFlagLocation() + class FlaggedDebugSignatures + { + static const uint Count = 2; + + uint idx; + const char* locations[Count]; + + public: + FlaggedDebugSignatures() : idx(0) + { std::fill_n(locations, Count, static_cast<char*>(0)); } + + void store(const char* method) + { locations[idx++ % Count] = method; } + + bool contains(const char *method) const + { return std::find(locations, locations + Count, method) != locations + Count; } + }; + +private: + QAtomicInt _ref; + +public: int loopLevel; - QAtomicPointer<QAbstractEventDispatcher> eventDispatcher; + QStack<QEventLoop *> eventLoops; QPostEventList postEventList; - bool canWait; + QThread *thread; + Qt::HANDLE threadId; + QAtomicPointer<QAbstractEventDispatcher> eventDispatcher; QVector<void *> tls; + FlaggedDebugSignatures flaggedSignatures; + + bool quitNow; + bool canWait; bool isAdopted; }; |