Hi ,

I have the below code where I am using threads **started signal** to ensure run function of the clientThread executes first and then any other function. All initialization are done in the run function and if any other function (serverConnect fn as below) executes first it creates issues.
But using logs I see that 1 in 10 times run function of clientThread executes after serverConnect().

Thank you,

Qt Code:
  1. void Base::drpThreadStarted()
  2. {
  3. /* Once DRP thread is started , start the client thread. */
  4. connect(clientThread,SIGNAL(started()),this,SLOT(clientThreadStarted()));
  5. clientThread->start();
  6. }
  7.  
  8.  
  9. void Base::clientThreadStarted()
  10. {
  11. /* Connect to the notification server. */
  12. clientThread->serverConnect();
  13.  
  14. /* Connect to the message queue in watchdog. */
  15. clientThread->watchdogConnect();
  16.  
  17. }
To copy to clipboard, switch view to plain text mode