Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt4-preview-feedback Archive, May 2007
[QT 4.3] BlockingQueuedConnection Dead lock


Message 1 in thread

Hi,

I am receiving the following warning when sending a signal over a blocking
queued connection:

*Qt: Dead lock detected while activating a BlockingQueuedConnection: Sender
is Class1(00A30878), receiver is Class2(00ABE4F4)*

which is sent from this piece of code in qobject.cpp:

*static void blocking_activate(QObject *sender, const QConnection &c, void
**argv, int idFrom, int idTo)
{
    if (sender->thread() == c.receiver - >thread()) {
        qWarning("Qt: Dead lock detected while activating a
BlockingQueuedConnection: "
            "Sender is %s(%p), receiver is %s(%p)",
            sender->metaObject()->className(), sender,
            c.receiver->metaObject()->className(), c.receiver);
    }

    QSemaphore semaphore;
    ::queued_activate(sender, c, argv, idFrom, idTo, &semaphore);
    semaphore.acquire();
} *

It is true that the thread which owns the sender object is the same as the
thread which owns the receiver object? However, the thread which is sending
the signal is not the owner of the sender object so I don't expect that a
dead lock would occur. What is the reason that the thread owner of the
sender object is checked rather than the current thread? Is it safe to
ignore the warning in this case?

Thanks,
Simon

Message 2 in thread

Hello Simon,

On Tuesday 08 May 2007 12:21:06 Simon Bourne wrote:
> However, the thread which is sending the signal is not the owner of the
> sender object so I don't expect that a dead lock would occur. What is the
> reason that the thread owner of the sender object is checked rather than the
> current thread? Is it safe to ignore the warning in this case?

You are right, it makes sense to check that the current thread is not the same 
as the receiver thread in this case. I think you can ignore the warning for 
now (and I'll see that it gets fixed for the final release).

Thanks for the report :)

-- 
 [ signature omitted ]