[Boost-bugs] [Boost C++ Libraries] #7125: weak_ptr::lock() thread safety

Subject: [Boost-bugs] [Boost C++ Libraries] #7125: weak_ptr::lock() thread safety
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-07-12 11:13:41


#7125: weak_ptr::lock() thread safety
----------------------------------------------+-----------------------------
 Reporter: Gennady Proskurin <gpr@…> | Owner: pdimov
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: smart_ptr
  Version: Boost 1.50.0 | Severity: Problem
 Keywords: |
----------------------------------------------+-----------------------------
 Imagine the following code:

 {{{
 shared_ptr<T> sp(new ...);
 weak_ptr<T> wp(sp);

 sp.reset(); // thread A
 shared_ptr<T> sp1 = wp.lock(); // thread B
 }}}

 It is not clear from documentation, whether it is safe to call
 shared_ptr::reset() and weak_ptr::lock() concurrently in different
 threads. It is very frequently asked question and should be documented
 explicitly.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7125>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC