Hi
I have a thread which run() metod looks like:
..
stopRequest = false;
while(1)
{
...
if(true==stopRequest){return;}
}
and ones metod in class
void closeRequest(){
stopRequest = true;
}
Both together are connected via signal&slot:
this->connect(this, SIGNAL(finished()), this, SLOT(stop()));
where:
void stop(){
if(isFinished() == false) {//error}
else{//OK}
//———————
My goal:
When closeRequest() is invoked run() metod is ended so finished() signal is emitted so stop slot is executed where thread’s status is checked. Supposedly isFinished() shall always returns true but sometimes/often isFinished returns false. Why?
Thanks
↧