How to force the run() function to execute first
Hi ,
I have below code where I see that the run function of the clientThread runs after the serverConnect() function. How can I force the run() function to execute first before serverConnect.
Thank you,
`
Code:
clientThread->start();
/* Connect to the notification server. */
clientThread->serverConnect();
Re: How to force the run() function to execute first
Hi,
You can use the SIGNAL "started" to a SLOT and in this SLOT call the other function.
Code:
connect(clientThread,SIGNAL(started()),this,SLOT(myThreadStarted()));
clientThread->start();
void myClass::myThreadStarted()
{
clientThread->serverConnect();
}
Re: How to force the run() function to execute first
It worked, Thanks for help!