Hello there!

In my code I'm using non-threadsafe classes from our company. For that I've splitted my application into two threads. The main thread runs the GUI, the other one the complete non-threadsafe process. Both communicate only via QueuedConnection's. The non-gui thread has a private class (created in thread::run()) which does all the work for it and notifies the thread object about everything that happens. To forward these notifies, the private and the working-thread class have the same signals and slots. These are simply connected to each other which may cause my problem: Deadlock

Qt Code:
  1. void thread::run()
  2. {
  3. // Delete the old object on restart
  4. if ( m_private )
  5. delete m_private;
  6.  
  7. // Create our private object
  8. m_private = new thread_private;
  9.  
  10. // And connect its signals to ours
  11. connect( m_private, SIGNAL(databaseOpened(bool)), this, SIGNAL(databaseOpened(bool)) );
  12. connect( m_private, SIGNAL(databaseOpening()) , this, SIGNAL(databaseOpening()) );
  13. }
To copy to clipboard, switch view to plain text mode 

The main window is connected on databaseOpened() etc. on the thread object.

Everything works except in one case: I'm starting a search from the database and get 200 results returned. For each result an event is fired (private (queued)-> thread (direct)-> mainwindow). There happens the deadlock and I can't explain why