diff options
Diffstat (limited to 'src/kernel/qobject.cpp')
-rw-r--r-- | src/kernel/qobject.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/kernel/qobject.cpp b/src/kernel/qobject.cpp index d8b2047a0..4442023a5 100644 --- a/src/kernel/qobject.cpp +++ b/src/kernel/qobject.cpp @@ -2727,7 +2727,7 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) sol->currentSender = this; } if ( c->memberType() == TQSIGNAL_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 TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) } else { if (object->d->ownThread && !object->d->ownThread->finished()) { +#ifdef QT_DEBUG + tqDebug("TQObject::activate_signal: Emitting cross-thread signal from object %p (member %d receiver %p) (1)\n\r", this, c->member(), object); +#endif // QT_DEBUG TQApplication::postEvent(object, new TQMetaCallEvent(c->member(), this, deepCopyTQUObjectArray(o), TQMetaCallEvent::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 TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) } else { if (object->d->ownThread && !object->d->ownThread->finished()) { +#ifdef QT_DEBUG + tqDebug("TQObject::activate_signal: Invoking cross-thread method from object %p (member %d receiver %p) (1)\n\r", this, c->member(), object); +#endif // QT_DEBUG TQApplication::postEvent(object, new TQMetaCallEvent(c->member(), this, deepCopyTQUObjectArray(o), TQMetaCallEvent::MetaCallInvoke)); } } @@ -2788,7 +2794,7 @@ void TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) sol->currentSender = this; } if ( c->memberType() == TQSIGNAL_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 TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) } else { if (object->d->ownThread && !object->d->ownThread->finished()) { +#ifdef QT_DEBUG + tqDebug("TQObject::activate_signal: Emitting cross-thread signal from object %p (member %d receiver %p) (2)\n\r", this, c->member(), object); +#endif // QT_DEBUG TQApplication::postEvent(object, new TQMetaCallEvent(c->member(), this, deepCopyTQUObjectArray(o), TQMetaCallEvent::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 TQObject::activate_signal( TQConnectionList *clist, TQUObject *o ) } else { if (object->d->ownThread && !object->d->ownThread->finished()) { +#ifdef QT_DEBUG + tqDebug("TQObject::activate_signal: Invoking cross-thread method from object %p (member %d receiver %p) (2)\n\r", this, c->member(), object); +#endif // QT_DEBUG TQApplication::postEvent(object, new TQMetaCallEvent(c->member(), this, deepCopyTQUObjectArray(o), TQMetaCallEvent::MetaCallInvoke)); } } |