[Qt-interest] how to debug a deadlock

Konrad Rosenbaum konrad at silmor.de
Wed Jul 14 16:21:09 CEST 2010


On Wed, July 14, 2010 13:48, Matthias Pospiech wrote:
> By putting a breakpoint at every locker (20+) I found the reason
> (calling a function with locking from a locked function).
> However I still wonder if it would be possible to get to know otherwise
> in which line the deadlock was caused.

This particular problem can be solved by creating the central lock as
Recursive. In that case it does not matter that it is locked again in the
same thread, but it still excludes other threads. The drawback is of
course that the lock uses up a few more CPU cycles, which should not
matter much in code that locks a serial (read: slow) interface.



    Konrad




More information about the Qt-interest-old mailing list