Opened 7 years ago
Closed 7 years ago
#11291 closed Bugs (duplicate)
Boost future continuations failing on OS X
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | thread |
Version: | Boost 1.58.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
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.
Change History (3)
comment:1 by , 7 years ago
Version: | Boost 1.57.0 → Boost 1.58.0 |
---|
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 7 years ago
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Is this a duplicate of #11290?