[Qt-interest] how to debug a deadlock

Matthias Pospiech matthias.pospiech at gmx.de
Wed Jul 14 13:29:28 CEST 2010


I have a dll sending commands using the serial port. The dll is from a 
company and I can only use it the way it is.
My problem is that this dll does not synchronise commands and replies 
over the serial port.
This becomes a problem if I send commands from different threads.

The simplest solution would be to ensure that all commands can only be 
called once at the same time.
So that the next command must wait for the previous to be finished. Here 
however is not difference between setting and getting
(or reading and writing), because the dll always sends and recieves for 
a single command.

Now my idea was to use a
QMutexLocker  locker( &mutex );

in every function sending commands with the dll.

This however leads to an immediate deadlock. QtCreator however does not 
show where this deadlock happend.
Now I wonder how to debug this?

Matthias



More information about the Qt-interest-old mailing list