Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thread: Added BOOST_THREAD_DONT_PROVIDE_THREAD_EQ, BOOST_THREAD_DONT_…
…USE_DATETIME and forbid their use when defined + Added BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION and future<>::then + Go towards don't throwing from the cpp files (refactor start_thread, join + Added #define BOOST_THREAD_VERSION 2 for the tests that runs only with version 2 [SVN r81023]
- Loading branch information
Showing
25 changed files
with
507 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (C) 2012 Vicente Botet | ||
// | ||
// 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) | ||
|
||
#define BOOST_THREAD_VERSION 4 | ||
#define BOOST_THREAD_DONT_PROVIDE_FUTURE_INVALID_AFTER_GET | ||
|
||
#include <boost/thread/future.hpp> | ||
#include <iostream> | ||
#include <string> | ||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION | ||
|
||
int p1() | ||
{ | ||
return 123; | ||
} | ||
|
||
int p2(boost::future<int>& f) | ||
{ | ||
return 2 * f.get(); | ||
} | ||
|
||
int main() | ||
{ | ||
boost::future<int> f1 = boost::async(p1); | ||
boost::future<int> f2 = f1.then(p2); | ||
std::cout << f2.get() << std::endl; | ||
return 0; | ||
} | ||
#else | ||
|
||
int main() | ||
{ | ||
return 0; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.