From a48454909960560e551d83e418a49c396370bfe9 Mon Sep 17 00:00:00 2001 From: Peter Tissen Date: Tue, 13 Sep 2016 15:35:12 +0200 Subject: [PATCH] add a future for each provide, hangs otherwise. Re-using the same future hangs for me at 'registration.get()' with both msvc on Windows and gcc4.9 on Debian --- examples/callee.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/callee.cpp b/examples/callee.cpp index a71d7588..42171920 100644 --- a/examples/callee.cpp +++ b/examples/callee.cpp @@ -92,7 +92,8 @@ int main(int argc, char** argv) boost::future connect_future; boost::future start_future; boost::future join_future; - boost::future provide_future; + boost::future provide_future_add; + boost::future provide_future_longop; connect_future = transport->connect().then([&](boost::future connected) { try { @@ -125,7 +126,7 @@ int main(int argc, char** argv) return; } - provide_future = session->provide("com.examples.calculator.add2", &add2).then( + provide_future_add = session->provide("com.examples.calculator.add2", &add2).then( [&](boost::future registration) { try { std::cerr << "registered procedure:" << registration.get().id() << std::endl; @@ -136,7 +137,7 @@ int main(int argc, char** argv) } }); - provide_future = session->provide("com.myapp.longop", &longop).then( + provide_future_longop = session->provide("com.myapp.longop", &longop).then( [&](boost::future registration) { try { std::cerr << "registered procedure:" << registration.get().id() << std::endl;