Boost logo

Boost :

From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-05-28 10:13:46

Stefan Seefeld <seefeld_at_[hidden]> writes:

> Anthony Williams wrote:
>>> t.join();
>>> ...
>>> assert(t.attached() == false); // doesn't sound right, does it ?
>> Seems OK to me. t is now "not-a-thread", so attached() should return
>> false.
> My point is that this is not a valid question to ask. To me 'not
> attached' suggests 'detached'. The 'joinable' concept as you describe it
> covers a larger domain than the 'attached / detached' concept, so the
> two aren't synonyms.

OK. t.joinable() /really/ means t represents a thread of
execution. However, the implication of the word is "t can be joined",
which is too narrow. t.attached() could indeed be read to mean "not
detached", which is also not really correct.

t.represents_a_thread() would be strictly correct, but is a bit

t.has_thread() is shorter.


Anthony Williams            | Just Software Solutions Ltd
Custom Software Development |
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Boost list run by bdawes at, gregod at, cpdaniel at, john at