[Interest] QTSPCosket signal disconnected()

Igor Mironchik imironchick at gmail.com
Tue Aug 21 11:20:35 CEST 2012


Hi

>>> Look at your backtrace and figure out what the other lock point was.
>> But just imagine a situation in which the potential for double locking
>> in a one-threaded environment is posiible.
>> It is not possible at all. But I see that when executing
>> ServerSocket::doThis() sometimes method ServerSocket::slotDisconnected()
>> is called asynchronously, so to speak. I.e. in the middle of
>> ServerSocket::doThis() invoked ServerSocket::slotDisconnected(). How
>> it's possible in one-threaded app?
> Well, doThis in your example sends data over the socket, in particular
> it flushes the data. This may result in the socket detecting that the
> connection was closed from the other side and hence the signal is
> emitted. In turn this means the slot connected to the signal is
> called.

Well, it's possible. Thaks.

> Since the mutex is locked in doThis and in the slot, but its not a
> recursive mutex you're dead-locked. However you don't need a mutex for
> a single-threaded app anyway, so just remove it.

I've added mutex only for test. Thaks again.




More information about the Interest mailing list