Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Peter Dimov Date : Sun Apr 17 2005 02:36 pm Chris Thomasson wrote: > // *** shared_ptr *** > > > 1. *Add this to public section: > ----------------- > > void tricky_copy( shared_ptr &r ) > { > pn.tricky_copy( r.pn ); > px = r.px; > } But how do you avoid the usual problem of a thread being preempted after pn.tricky_copy and before px = r.px? r.px may have been changed and no longer in sync with the old r.pn. .