Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2007-03-27 10:24:29


"Peter Dimov" <pdimov_at_[hidden]> writes:

> In implementation terms:
>
> class thread
> {
> pthread_t handle_;
> bool detached_;
>
> public:
>
> thread(): detached_( false ) {}
>
> void detach() { atomic_store( &detached_, true ); }
>
> // (try-/timed-) 'const' joins
>
> ~thread()
> {
> if( !detached_ ) cancel();
> pthread_detach( handle_ );
> }
> };
>
> Is this not a conforming N2184 thread? If not, why?

As I understand it: No, because t.joinable() would still be true, and you
could still cancel and join the thread.

Anthony

-- 
Anthony Williams
Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

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