[Boost-bugs] [Boost C++ Libraries] #7575: A future created by async should "join" in the destructor

Subject: [Boost-bugs] [Boost C++ Libraries] #7575: A future created by async should "join" in the destructor
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-26 07:34:58


#7575: A future created by async should "join" in the destructor
------------------------------------------------------+---------------------
 Reporter: Andrzej Krzemienski <akrzemi1@…> | Owner: anthonyw
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: async future block |
------------------------------------------------------+---------------------
 The C++ Standard requires (Section 3.6.8, Paragraph 5) in cases where
 std::async() creates a future and no explicit waiting function is called
 for the future, that "the associated thread completion synchronizes with
 [...] with the return from the last function that releases the shared
 state [...]".

 This effectively means that destructor of such future must wait until the
 associated thread finishes. This requirement makes std::async() a tool
 that behaves like RAII classes: it binds the resource (the associated
 thread) with the life-time of the future object.

 Boost.Thread should follow the same behavior for futures created with
 async (when called with parameter launch::async).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7575>
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:11 UTC