summaryrefslogtreecommitdiffstats
path: root/src/kernel/qobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qobject.cpp')
-rw-r--r--src/kernel/qobject.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp
index 9e5ac8e..247db41 100644
--- a/src/kernel/qobject.cpp
+++ b/src/kernel/qobject.cpp
@@ -2727,7 +2727,7 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
sol->currentSender = this;
}
if ( c->memberType() == QSIGNAL_CODE ) {
- if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
+ if ((d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) || (currentThread->threadPostedEventsDisabled()) || (object->d->ownThread == currentThread)) {
#ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock();
#endif // QT_THREAD_SUPPORT
@@ -2738,12 +2738,15 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
}
else {
if (object->d->ownThread && !object->d->ownThread->finished()) {
+#ifdef QT_DEBUG
+ qDebug("QObject::activate_signal: Emitting cross-thread signal from object %p (member %d receiver %p) (1)\n\r", this, c->member(), object);
+#endif // QT_DEBUG
QApplication::postEvent(object, new QMetaCallEvent(c->member(), this, deepCopyQUObjectArray(o), QMetaCallEvent::MetaCallEmit));
}
}
}
else {
- if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
+ if ((d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) || (currentThread->threadPostedEventsDisabled()) || (object->d->ownThread == currentThread)) {
#ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock();
#endif // QT_THREAD_SUPPORT
@@ -2754,6 +2757,9 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
}
else {
if (object->d->ownThread && !object->d->ownThread->finished()) {
+#ifdef QT_DEBUG
+ qDebug("QObject::activate_signal: Invoking cross-thread method from object %p (member %d receiver %p) (1)\n\r", this, c->member(), object);
+#endif // QT_DEBUG
QApplication::postEvent(object, new QMetaCallEvent(c->member(), this, deepCopyQUObjectArray(o), QMetaCallEvent::MetaCallInvoke));
}
}
@@ -2788,7 +2794,7 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
sol->currentSender = this;
}
if ( c->memberType() == QSIGNAL_CODE ) {
- if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
+ if ((d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) || (currentThread->threadPostedEventsDisabled()) || (object->d->ownThread == currentThread)) {
#ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock();
#endif // QT_THREAD_SUPPORT
@@ -2799,12 +2805,15 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
}
else {
if (object->d->ownThread && !object->d->ownThread->finished()) {
+#ifdef QT_DEBUG
+ qDebug("QObject::activate_signal: Emitting cross-thread signal from object %p (member %d receiver %p) (2)\n\r", this, c->member(), object);
+#endif // QT_DEBUG
QApplication::postEvent(object, new QMetaCallEvent(c->member(), this, deepCopyQUObjectArray(o), QMetaCallEvent::MetaCallEmit));
}
}
}
else {
- if ((d->disableThreadPostedEvents) || (object->d->ownThread == currentThread)) {
+ if ((d->disableThreadPostedEvents) || (object->d->disableThreadPostedEvents) || (currentThread->threadPostedEventsDisabled()) || (object->d->ownThread == currentThread)) {
#ifdef QT_THREAD_SUPPORT
sol->listMutex->unlock();
#endif // QT_THREAD_SUPPORT
@@ -2815,6 +2824,9 @@ void QObject::activate_signal( QConnectionList *clist, QUObject *o )
}
else {
if (object->d->ownThread && !object->d->ownThread->finished()) {
+#ifdef QT_DEBUG
+ qDebug("QObject::activate_signal: Invoking cross-thread method from object %p (member %d receiver %p) (2)\n\r", this, c->member(), object);
+#endif // QT_DEBUG
QApplication::postEvent(object, new QMetaCallEvent(c->member(), this, deepCopyQUObjectArray(o), QMetaCallEvent::MetaCallInvoke));
}
}