Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-09-17 06:45:52


From: <williamkempf_at_[hidden]>
> --- In boost_at_y..., "Ed Brey" <edbrey_at_y...> wrote:
> > I'm confused by this. Your documentation for join says that the
> > only effect is to block.
>
> No, it says more than this. It says that all resources are
> reclaimed. Reading the current documentation I see that the wording
> isn't specific enough to make clear what this means and I should work
> on it. One of the resources that's reclaimed is the "thread id".
> This means that after a call to thread::join() all other operations
> are invalid on the thread object, the same as attempting to read or
> write to/from an fstream that's been closed.

IOW join() invalidates the object. The only allowed operation is
destruction. Everything else invokes undefined behavior.

I can live with such a join. However I think that an equally viable
alternative is a join() that doesn't invalidate. I don't see what is gained
by making access to a joined thread undefined behavior.

--
Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk