summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_p.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-11 16:12:21 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-11 16:12:35 +0200
commitd0eb444a49f6064ecb896f62276e060cd8a4b1e8 (patch)
tree34d8dd637baf665225ada73e76604531cd2c75e5 /src/corelib/thread/qthread_p.h
parentda0cb32b8ee7cc4a991a59420a411898e63a660e (diff)
parent894f86709080fe8d20875b402adce679963c49c2 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/corelib/thread/qthread_p.h')
-rw-r--r--src/corelib/thread/qthread_p.h39
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;
};