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 
void thread::run()
{
// Delete the old object on restart
if ( m_private )
delete m_private;
// Create our private object
m_private = new thread_private;
// And connect its signals to ours
connect( m_private, SIGNAL(databaseOpened(bool)), this, SIGNAL(databaseOpened(bool)) );
connect( m_private, SIGNAL(databaseOpening()) , this, SIGNAL(databaseOpening()) );
}
void thread::run()
{
// Delete the old object on restart
if ( m_private )
delete m_private;
// Create our private object
m_private = new thread_private;
// And connect its signals to ours
connect( m_private, SIGNAL(databaseOpened(bool)), this, SIGNAL(databaseOpened(bool)) );
connect( m_private, SIGNAL(databaseOpening()) , this, SIGNAL(databaseOpening()) );
}
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
Bookmarks