Boost logo

Boost :

Subject: Re: [boost] Using Boost.Atomic for shared_ptr
From: Helge Bahmann (hcb_at_[hidden])
Date: 2009-12-22 02:42:16

On Mon, 21 Dec 2009, Peter Dimov wrote:
> Relaxed is fine for add_ref. The decrements need to be acqrel.
> use_count() needs acquire.

I think that decrement can be:

if (use_count_.fetch_sub(1, memory_order_release)==1) {

i.e. save the acquire unless the object is going to be deleted.


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