|
Boost Users : |
Subject: Re: [Boost-users] Thread Safety of shared_ptr
From: Kevin Frey (kfrey_at_[hidden])
Date: 2011-05-03 17:38:51
> This is OK. Manipulating different shared_ptr instances in different
threads is fine.
> The example states that you can't, in thread B, destroy the shared_ptr
which thread A
> copies (*sp_Session in your code). Destroying other shared_ptr
instances is allowed,
> regardless of whether or with what they share ownership. The thread
safety rules work
> on shared_ptr instances, not on their pointees. You can replace
shared_ptr with std::string
> (or even int) in the examples and they will be equally valid (provided
that reset is
> replaced with assignment). (Although I admit that the variable names
are used somewhat
> loosely.)
Okay! Thank-you. Now I am getting an understanding.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net