Re: [Boost-bugs] [Boost C++ Libraries] #12293: boost::future::then lambda called before future is ready.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12293: boost::future::then lambda called before future is ready.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-08-08 23:32:57


#12293: boost::future::then lambda called before future is ready.
----------------------------------+-------------------------
  Reporter: Jeffrey.Gramowski@… | Owner: viboes
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.60.0 | Severity: Problem
Resolution: | Keywords: future then
----------------------------------+-------------------------

Comment (by viboes):

 You should store the returned future otherwise it will block in


 {{{
         std::async(std::launch::async, [&promise2, &tmpValue](){
             std::this_thread::sleep_for(std::chrono::seconds(1));
             tmpValue = 1;
             promise2.set_value();
         });
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12293#comment:4>
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:20 UTC