> Oops, I just noticed there's still a potentially fatal race --> bug 1318632
>
> We should fix that here because it's the same section of code. And then once
> you have removed the reference it might be safe to drop the reserve() call.
Concerning that bug, my understanding is that std::shared_ptr can handle the scenario described in a thread-safe manner without any external synchronization (the control block of a shared_ptr which is what is shared between instances is thread safe).
> Oops, I just noticed there's still a potentially fatal race --> bug 1318632
>
> We should fix that here because it's the same section of code. And then once
> you have removed the reference it might be safe to drop the reserve() call.
Concerning that bug, my understanding is that std::shared_ptr can handle the scenario described in a thread-safe manner without any external synchronization (the control block of a shared_ptr which is what is shared between instances is thread safe).