Well I found the problem... But still I don't know why it happens... From the father of UserThread I call:
if(!userThread->isRunning()){
userThread->start();
while(!userThread->inizializzato()); //Stalls here
}
if(!userThread->isRunning()){
userThread->start();
while(!userThread->inizializzato()); //Stalls here
}
To copy to clipboard, switch view to plain text mode
with
void UserThread::run(){
//.......
_inizializzato=TRUE;
exec();
}
bool UserThread::inizializzato() const {return _inizializzato;}
void UserThread::run(){
//.......
_inizializzato=TRUE;
exec();
}
bool UserThread::inizializzato() const {return _inizializzato;}
To copy to clipboard, switch view to plain text mode
the program stalls in the "while".Now, if i run in debug mode, _inizializzato is correcly set up to TRUE and the program doesn't stall, in release mode, _inizializzato is never set to TRUE (_inzializzato is set to FALSE in the constructor) and the programs stalls.
I suppose I can delete the problem if I wait for a signal coming from the thread instead of using that while but... Is this mine a bad style of programming?
Thanks for the attention and the patience!
Bookmarks