diff options
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; }; |