Boost logo

Boost :

From: Dave Compton (abcdave_at_[hidden])
Date: 2006-08-02 10:46:33


Caleb Epstein wrote:
> On 8/1/06, Dave Compton <abcdave_at_[hidden]> wrote:
>
>
>>Is it enough to use an atomic counter? It seems like the entire
>>decrement *and test* operation in intrusive_ptr_release
>>needs to be atomic. Otherwise you run the risk of
>>the "// whatever" code being executed twice in
>>different threads.
>
>
> Shouldn't atomic_count::operator-- return 0 in one and only one
> thread? If not, it wouldn't be a very good atomic counter...
>

Yes, thank you for making that clear.


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