Skip to content

Commit

Permalink
Thread: fix issue with continuation's future parameter which must tak…
Browse files Browse the repository at this point in the history
…en by value.

[SVN r84979]
  • Loading branch information
viboes committed Jul 7, 2013
1 parent d759dd2 commit 794d54a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/future_then.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int p1()
return 123;
}

int p2(boost::future<int>& f)
int p2(boost::future<int> f)
{
BOOST_THREAD_LOG << "<P2" << BOOST_THREAD_END_LOG;
try
Expand All @@ -38,7 +38,7 @@ int p2(boost::future<int>& f)
}
BOOST_THREAD_LOG << "P2>" << BOOST_THREAD_END_LOG;
}
int p2s(boost::shared_future<int>& f)
int p2s(boost::shared_future<int> f)
{
BOOST_THREAD_LOG << "<P2" << BOOST_THREAD_END_LOG;
try
Expand Down
2 changes: 1 addition & 1 deletion example/lambda_future.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main()
}
{
boost::future<int> f1 = boost::async(boost::launch::async, []() {return 123;});
boost::future<int> f2 = f1.then([](boost::future<int>& f) {return 2*f.get(); });
boost::future<int> f2 = f1.then([](boost::future<int> f) {return 2*f.get(); });
int result = f2.get();
BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG;
}
Expand Down
3 changes: 3 additions & 0 deletions example/tennis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#undef BOOST_THREAD_VERSION
#define BOOST_THREAD_VERSION 2

#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/thread_only.hpp>
Expand Down

0 comments on commit 794d54a

Please sign in to comment.