Hi Boris,
On Sun, Sep 12, 2010 at 12:04 AM, Boris Schaeling
Sorry, I wasn't clear then. I'm trying to find out how I can easily tell whether a thread of execution has terminated:
boost::thread t(...); // thread of execution runs bool running = t.joinable(); // thread of execution terminates (automatically) bool still_running = t.joinable();
Does joinable() return true in the first case and false in the second?
No, it will return true both times.
The documentation says that in the second case join() returns immediately. However I don't want to call join() because it would block in the first case. I would need to know in advance whether the thread of execution has terminated or not - this is exactly what I'd like boost::thread to tell me. :)
Maybe you can use boost::thread::timed_join() with a very low timeout (or even zero timeout, haven't checked if it works like that).
Boris
Cheers, Francesco.