3 May
2011
3 May
'11
9:38 p.m.
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.