summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-12-12 13:52:41 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-12-21 02:04:12 +0100
commitc3a2b9f35a9a12ff3c6f5f0d11844de161b47c2a (patch)
tree8c35621da19aa81145f32c703d268159f7b63b50 /src/corelib/thread/qthread.cpp
parentfd38df3ec34238d9886be754ae1b5c9e8b10cc4b (diff)
Add categorized logging of delete later machinery
A QT_MESSAGE_PATTERN including %{backtrace depth=4} should give the call site of the QScopedScopeLevelCounter. Task-number: QTBUG-120124 Change-Id: Ie477994882bde9168c931479102017ad5fde426a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r--src/corelib/thread/qthread.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index a1c2c26e37..b45ff17373 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -147,6 +147,21 @@ void QAdoptedThread::run()
qFatal("QAdoptedThread::run(): Internal error, this implementation should never be called.");
}
+QScopedScopeLevelCounter::QScopedScopeLevelCounter(QThreadData *threadData)
+ : threadData(threadData)
+{
+ ++threadData->scopeLevel;
+ qCDebug(lcDeleteLater) << "Increased" << threadData->thread
+ << "scope level to" << threadData->scopeLevel;
+}
+
+QScopedScopeLevelCounter::~QScopedScopeLevelCounter()
+{
+ --threadData->scopeLevel;
+ qCDebug(lcDeleteLater) << "Decreased" << threadData->thread
+ << "scope level to" << threadData->scopeLevel;
+}
+
/*
QThreadPrivate
*/