Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-03-24 12:33:21


Malte Starostik wrote:
> {to moderator: sorry, picked the wrong sender address last time, this
> one is subscribed}
>
> Hi,
>
> looking through the docs I can't seem to find a way to query
> boost::thread whether it's still running or has terminated and if so if
> it's still joinable. Is that information available somehow or do I need
> to keep track myself?

In general you can't know that a thread is still running, because it may
exit immediately after you find that it is. As for joinability, it's
currently the client's responsibility to ensure that it only attempts to
join a thread once (but this may change). If you want to know whether a
thread has finished its work without necessarily waiting for it to do
so, you can find your own method for the thread to signal this (which
should probably involve a condition variable).

Ben.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net