Fw: [patch] Make std::tr1::shared_ptr thread-safe.

Alexander Terekhov alexander.terekhov@gmail.com
Sat Apr 2 21:07:00 GMT 2005


On Apr 2, 2005 10:33 PM, Peter Dimov <pdimov@mmltd.net> wrote:
[...]
> struct X
> {
>    int v;
> 
>    X(): v( 0 ) {}
>    ~X() { v = 1; }
> };
> 
> and with several billion repetitions of
> 
> assert( px->v == 0 );
> px.reset();

int v = px->v;
px.reset();
assert(v == 0);

is likely to "fail faster", so to speak.

regards,
alexander.



More information about the Libstdc++ mailing list