
2 May
2011
2 May
'11
8:17 p.m.
On 5/2/2011 1:08 PM, Emil Dotchevski wrote:
Keep in mind multi-threading issues too. The way the shared_ptr framework deals with this is that weak_ptr::lock() returns a shared_ptr, so if the object hasn't yet expired at the time lock() is called, it can't expire later (since the returned shared_ptr keeps it afloat.) This is what makes using weak_ptr for cyclic references safe.
Thanks for the notice. Right now block_ptr locks a mutex when a cyclic set is being destroyed. -Phil