|
Boost : |
Subject: Re: [boost] [thread] countdown_latch
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2013-04-21 07:08:26
On Apr 21, 2013, at 6:45 AM, "Vicente J. Botet Escriba" <vicente.botet_at_[hidden]> wrote:
> Le 21/04/13 10:27, Michael Marcin a écrit :
>> I recently ran across the need to spawn a thread and wait for it to finish its setup before continuing.
>>
>> The accepted answer seems to be using a mutex and condition variable to achieve this.
>>
>> However that work clutters up the code quite a bit with the implementation details.
>>
>> I came across Java's CountDownLatch which does basically the same work but bundles it up into a tidy package.
>>
>>
> What about using boost::barrier
Of course. I'd forgotten Boost.Thread had that. I wish the standard library had included it.
___
Rob
(Sent from my portable computation engine)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk