summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_unix.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2016-02-19 20:02:30 +0100
committerDavid Faure <david.faure@kdab.com>2016-07-28 12:03:47 +0000
commitc9354429dd90aff3f1174d0b56515cb4a8aef9c2 (patch)
tree0c42d6945a781f31bd82321b757a60142ada713d /src/corelib/kernel/qeventdispatcher_unix.cpp
parentfdd15b7f99a54d37090a3bedb44815603edc53a5 (diff)
QSocketNotifier: improve warning to show thread names and pointers.
Much like the QObject::setParent() warning, which helps a bit when debugging. Change-Id: I2abf277a12aa1ce04bd8b5759f46f8bfdcb25383 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_unix.cpp')
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 9afbb84abf..802962d77d 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -421,7 +421,12 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier)
QSocketNotifier::Type type = notifier->type();
#ifndef QT_NO_DEBUG
if (notifier->thread() != thread() || thread() != QThread::currentThread()) {
- qWarning("QSocketNotifier: socket notifiers cannot be disabled from another thread");
+ qWarning("QSocketNotifier: socket notifier (fd %d) cannot be disabled from another thread.\n"
+ "(Notifier's thread is %s(%p), event dispatcher's thread is %s(%p), current thread is %s(%p))",
+ sockfd,
+ notifier->thread() ? notifier->thread()->metaObject()->className() : "QThread", notifier->thread(),
+ thread() ? thread()->metaObject()->className() : "QThread", thread(),
+ QThread::currentThread() ? QThread::currentThread()->metaObject()->className() : "QThread", QThread::currentThread());
return;
}
#endif