|
Boost : |
From: William Kempf (williamkempf_at_[hidden])
Date: 2001-08-17 09:32:41
From: "Peter Dimov" <pdimov_at_[hidden]>
>From: "William Kempf" <williamkempf_at_[hidden]>
>>I'd prefer to
>>leave join() as an explicit operation. The destructor shall either detach
>>the thread if it is still "joinable", or do nothing if it's been joined.
>How would you implement this? When a default-constructed thread object is
>destroyed it doesn't know whether the thread has been already joined.
Read the description a little closer. A "default-constructed thread object"
is not joinable. Only the thread object that actually creates the thread is
joinable (and only until it calls join() once). In actuality this design is
by far easier to implement, especially on POSIX threads.
Bill Kempf
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk