Hello all,
gotta question:
i've started my thread, everything's great. Now I'd like to end it. Calling exit() exits the threads event loop. I assume it does so immediately. But in order to make sure that my thread really has finished, I'll need to do something like the following:
Qt Code:
  1. int BaseDevice::stopThread ()
  2. {
  3. quit();
  4. if(wait ( interval() ))
  5. ;//ok
  6. else{
  7. log("stopThread() timed out", _TIMEOUT_ERROR);
  8. //terminate(); //dangerous
  9. }
  10. return 0;
  11. }
To copy to clipboard, switch view to plain text mode 
Thus I have a function that will wait until run() is finished. Question: does it work that way? That is, does wait() wait for event loop to exit (in which case the above doesn't work) or does it wait for run() to exit?

thanks
K