Subject: [Boost-bugs] [Boost C++ Libraries] #11291: Boost future continuations failing on OS X
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-13 01:23:56
#11291: Boost future continuations failing on OS X
------------------------------+-------------------------
Reporter: chappedm@⦠| Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.57.0 | Severity: Showstopper
Keywords: |
------------------------------+-------------------------
I have a problem with using boost future continuations via then(). I am
building Boost 1.58 for both Linux 64-bit and OS X 64-bit. I have the
following code that executes correctly:
{{{
auto future = session().join(m_realm);
uint64_t session_id = future.get();
TRACE(trace_logger) << "session joined: session_id " <<
session_id;
}}}
However if I re-write it as:
{{{
auto future = session().join(m_realm).then(
[](boost::future<uint64_t>) {
uint64_t session_id = future.get();
TRACE(trace_logger) << "session joined: session_id " <<
session_id;
}).wait();
}}}
then the continuation is never called and I am stuck waiting on this
future to be resolved for indefinitely. Seems to be a data race of some
kind. Unfortunately, I don't have a minimal test case to reproduce the
issue yet. If I force the promise to be satisfied before acquiring the
future and calling wait then it works as expected. So I suspect that this
is a data race of sorts.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11291> 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:18 UTC