summaryrefslogtreecommitdiff
path: root/libs/thread
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:30:07 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:32:57 +0900
commit71d216b90256936a9638f325af9bc69d720e75de (patch)
tree9c5f682d341c7c88ad0c8e3d4b262e00b6fb691a /libs/thread
parent733b5d5ae2c5d625211e2985ac25728ac3f54883 (diff)
downloadboost-71d216b90256936a9638f325af9bc69d720e75de.tar.gz
boost-71d216b90256936a9638f325af9bc69d720e75de.tar.bz2
boost-71d216b90256936a9638f325af9bc69d720e75de.zip
Imported Upstream version 1.59.0
Change-Id: I2dde00f4eca71df3eea9d251dcaecde18a6c90a5 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'libs/thread')
-rw-r--r--libs/thread/doc/compliance.qbk59
-rw-r--r--libs/thread/example/executor.cpp16
-rw-r--r--libs/thread/example/lambda_future.cpp8
-rw-r--r--libs/thread/test/sync/futures/when_all/iterators_pass.cpp2
-rw-r--r--libs/thread/test/sync/futures/when_all/one_pass.cpp2
-rw-r--r--libs/thread/test/sync/futures/when_all/variadic_pass.cpp2
-rw-r--r--libs/thread/test/sync/futures/when_any/iterators_pass.cpp2
-rw-r--r--libs/thread/test/sync/futures/when_any/one_pass.cpp2
-rw-r--r--libs/thread/test/sync/futures/when_any/variadic_pass.cpp2
-rw-r--r--libs/thread/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp2
-rw-r--r--libs/thread/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp2
11 files changed, 77 insertions, 22 deletions
diff --git a/libs/thread/doc/compliance.qbk b/libs/thread/doc/compliance.qbk
index 6846f54c19..06e4ca82b8 100644
--- a/libs/thread/doc/compliance.qbk
+++ b/libs/thread/doc/compliance.qbk
@@ -1,13 +1,15 @@
[/
- (C) Copyright 2011-2013 Vicente J. Botet Escriba.
+ (C) Copyright 2011-2015 Vicente J. Botet Escriba.
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).
]
[section:compliance Conformance and Extension]
+[////////////////////////////////////////////]
[section:cpp11 C++11 standard Thread library]
+[///////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3376.html C++11 - Standard for Programming Language C++]]]
@@ -88,6 +90,7 @@
]
[endsect]
[section:cxx14 C++14 standard Thread library - accepted changes]
+[//////////////////////////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3797.html Working Draft, Standard for Programming Language C++]]
@@ -103,6 +106,7 @@
[section:cxx1y C++14 TS Extensions for Concurrency V1 ]
+[/////////////////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4107.html N4107-Extensions for Concurrency]]
@@ -126,8 +130,10 @@
[endsect]
[section:cxx1y C++1z TS Concurrency - On going proposals]
+[///////////////////////////////////////////////////////]
[section:latch C++ Latches and Barriers]
+[//////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3600.html N3600 C++ Latches and Barriers]]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3817.html N3817 C++ Latches and Barriers]]
@@ -140,6 +146,7 @@
[endsect]
[section:queue C++ Concurrent Queues]
+[///////////////////////////////////]
[note [@ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3533.html N3533 C++ Concurrent Queues]]
@@ -183,24 +190,25 @@
[[X.3.4] [Managed Indirection] [No] [ - ]]
]
[endsect]
-[section:executors Asynchronous Executors]
+[section:executors Executors and Schedulers]
+[//////////////////////////////////////////]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3785.pdf N3785 Executors and Schedulers]]
-[table Asynchronous Executors
+[table Executors and Schedulers
[[Section] [Description] [Status] [Comments]]
- [[V.1.1] [Class executor] [Yes] [ - ]]
- [[V.1.1] [add] [Yes] [ renamed with a function template submit ]]
- [[V.1.1] [num_of_pendin_closures] [No] [ ]]
+ [[V.1.1] [Class `executor`] [Yes] [ - ]]
+ [[V.1.1] [`add`] [Yes] [ renamed with a function template `submit` ]]
+ [[V.1.1] [`num_of_pendin_closures`] [No] [ ]]
[[V.1.2] [Class sceduled_executor] [No] [ - ]]
- [[V.1.2] [add_at] [No] [ renamed with a function template submit_at ]]
- [[V.1.2] [add_after] [No] [ renamed with a function template submit_after ]]
+ [[V.1.2] [`add_at`] [No] [ renamed with a function template `scheduler::submit_at` ]]
+ [[V.1.2] [`add_after`] [No] [ renamed with a function template `scheduler::submit_after` ]]
[[V.2] [Concrete executor classes] [No] [ - ]]
- [[V.2.1] [thread_pool] [Yes] [ static version Basic_thread_pool, dynamic one execduler_adaptor<basic_thread_pool> ]]
- [[V.2.2] [serial_executor] [yes] [ - ]]
- [[V.2.3] [loop_executor] [Yes] [ static version loop_scheduler, dynamic one execduler_adaptor<loop_scheduler> ]]
- [[V.2.4] [inline_executor] [Yes] [ static version inline_executor, dynamic one execduler_adaptor<inline_executor> ]]
- [[V.2.5] [thread_executor] [Yes] [ static version thread_executor, dynamic one execduler_adaptor<thread_executor> ]]
+ [[V.2.1] [`thread_pool`] [Yes] [ static version `basic_thread_pool`, dynamic one `execduler_adaptor<basic_thread_pool>` ]]
+ [[V.2.2] [`serial_executor`] [yes] [ - ]]
+ [[V.2.3] [`loop_executor`] [Yes] [ static version loop_scheduler, dynamic one `execduler_adaptor<loop_scheduler>` ]]
+ [[V.2.4] [`inline_executor`] [Yes] [ static version `inline_executor`, dynamic one `execduler_adaptor<inline_executor>` ]]
+ [[V.2.5] [`thread_executor`] [Yes] [ static version `thread_executor`, dynamic one `execduler_adaptor<thread_executor>` ]]
]
[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3784.pdf N3784-Improvements to `std::future<T> and Related APIs]]
@@ -212,8 +220,31 @@
[[30.6.8] [`async`] [Yes] [ - ]]
]
+[note [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4143.pdf N4143-Executors and schedulers, revision 4]]
+
+[table Executors and Schedulers - revision 4
+ [[Section] [Description] [Status] [Comments]]
+ [[VI.A] [Executor Concept] [Yes] [ `wrapper_type` renamed by `work` and `spawn by `submit` ]]
+ [[VI.A.1] [`thread_per_task_executor] [Yes] [ renamed `thread_executor`]]
+ [[VI.A.2] [`thread_pool_executor`] [Yes] [ renamed `basic_thread_pool`]]
+ [[VI.A.3] [`system_executor`] [No] [ - ]]
+ [[VI.A.4] [`loop_executor`] [Yes] [ - ]]
+ [[VI.A.5] [`serial_executor`] [yes] [ - ]]
+ [[VI.B] [`executor_ref`] [yes] [ - ]]
+ [[VI.C] [`executor`] [yes] [ renamed `gen_executor_ref` ]]
+ [[VI.D] [Free Functions and Helper Objects] [partial] [ - ]]
+ [[VI.D] [`make_package`] [No] [ - ]]
+ [[VI.D] [`spawn_future`] [No] [ `async(Ex&, ...)` is similar but returns a blocking future. ]]
+ [[VI.D] [`spawn`] [No] [ - ]]
+ [[VI.D] [`task_wrapper`] [No] [ renamed `resubmitter` ]]
+ [[VI.D] [`set_executor`] [No] [ renamed `resubmit` ]]
+ [[VI.D] [`function_wrapper`] [Partial] [ renamed `work` ]]
+]
+
[endsect]
+[//////////////////////////////////////////////////////////////
[section:stream_mutex C++ Stream Mutexes - C++ Stream Guards]
+[/////////////////////////////////////////////////////////////]
While Boost.Thread implementation of stream mutexes differ in the approach, it is worth comparing with the current trend on the standard.
@@ -241,7 +272,7 @@ While Boost.Thread implementation of stream mutexes differ in the approach, it i
[endsect]
-
+///////////////////////////////]
[endsect]
[endsect]
diff --git a/libs/thread/example/executor.cpp b/libs/thread/example/executor.cpp
index 7f6b1ce3e0..10c77a0007 100644
--- a/libs/thread/example/executor.cpp
+++ b/libs/thread/example/executor.cpp
@@ -28,6 +28,10 @@
#include <string>
#include <iostream>
+boost::future<void> p(boost::future<void>) {
+ return boost::make_ready_future();
+}
+
void p1()
{
// std::cout << BOOST_CONTEXTOF << std::endl;
@@ -147,4 +151,16 @@ int test_executor_adaptor()
int main()
{
return test_executor_adaptor();
+
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION \
+ && defined BOOST_THREAD_PROVIDES_EXECUTORS \
+ && ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
+
+ // compiles
+ boost::make_ready_future().then(&p);
+
+ boost::basic_thread_pool executor;
+ // doesn't compile
+ boost::make_ready_future().then(executor, &p);
+#endif
}
diff --git a/libs/thread/example/lambda_future.cpp b/libs/thread/example/lambda_future.cpp
index 6df1cee7f7..fd15d44840 100644
--- a/libs/thread/example/lambda_future.cpp
+++ b/libs/thread/example/lambda_future.cpp
@@ -42,6 +42,14 @@ int main()
int result = f2.get();
BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG;
}
+#if ! defined BOOST_NO_CXX14_GENERIC_LAMBDAS
+ {
+ boost::future<int> f1 = boost::async(boost::launch::async, []() {return 123;});
+ boost::future<int> f2 = f1.then([](auto f) {return 2*f.get(); });
+ int result = f2.get();
+ BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG;
+ }
+#endif
}
catch (std::exception& ex)
{
diff --git a/libs/thread/test/sync/futures/when_all/iterators_pass.cpp b/libs/thread/test/sync/futures/when_all/iterators_pass.cpp
index 2316a8d197..cebf4192d1 100644
--- a/libs/thread/test/sync/futures/when_all/iterators_pass.cpp
+++ b/libs/thread/test/sync/futures/when_all/iterators_pass.cpp
@@ -281,7 +281,7 @@ int main()
BOOST_TEST(res[1].is_ready());
BOOST_TEST(res[1].get() == 321);
}
-#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
+#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);
diff --git a/libs/thread/test/sync/futures/when_all/one_pass.cpp b/libs/thread/test/sync/futures/when_all/one_pass.cpp
index 437d3ea531..a39e638e2b 100644
--- a/libs/thread/test/sync/futures/when_all/one_pass.cpp
+++ b/libs/thread/test/sync/futures/when_all/one_pass.cpp
@@ -152,7 +152,7 @@ int main()
BOOST_TEST(boost::csbl::get<0>(res).is_ready());
BOOST_TEST(boost::csbl::get<0>(res).get() == 123);
}
-#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
+#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);
diff --git a/libs/thread/test/sync/futures/when_all/variadic_pass.cpp b/libs/thread/test/sync/futures/when_all/variadic_pass.cpp
index 4d34e6f87e..1c864c5946 100644
--- a/libs/thread/test/sync/futures/when_all/variadic_pass.cpp
+++ b/libs/thread/test/sync/futures/when_all/variadic_pass.cpp
@@ -236,7 +236,7 @@ int main()
BOOST_TEST(boost::csbl::get<1>(res).is_ready());
BOOST_TEST(boost::csbl::get<1>(res).get() == 321);
}
-#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
+#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);
diff --git a/libs/thread/test/sync/futures/when_any/iterators_pass.cpp b/libs/thread/test/sync/futures/when_any/iterators_pass.cpp
index 21e2a0efd3..75a30cc4b2 100644
--- a/libs/thread/test/sync/futures/when_any/iterators_pass.cpp
+++ b/libs/thread/test/sync/futures/when_any/iterators_pass.cpp
@@ -283,7 +283,7 @@ int main()
BOOST_TEST(res[1].is_ready());
BOOST_TEST(res[1].get() == 321);
}
-#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
+#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);
diff --git a/libs/thread/test/sync/futures/when_any/one_pass.cpp b/libs/thread/test/sync/futures/when_any/one_pass.cpp
index 50f5dab563..f54d83769f 100644
--- a/libs/thread/test/sync/futures/when_any/one_pass.cpp
+++ b/libs/thread/test/sync/futures/when_any/one_pass.cpp
@@ -125,7 +125,7 @@ int main()
BOOST_TEST(boost::csbl::get<0>(res).is_ready());
BOOST_TEST(boost::csbl::get<0>(res).get() == 123);
}
-#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
+#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);
diff --git a/libs/thread/test/sync/futures/when_any/variadic_pass.cpp b/libs/thread/test/sync/futures/when_any/variadic_pass.cpp
index e59b3a7906..cee81ef13e 100644
--- a/libs/thread/test/sync/futures/when_any/variadic_pass.cpp
+++ b/libs/thread/test/sync/futures/when_any/variadic_pass.cpp
@@ -225,7 +225,7 @@ int main()
BOOST_TEST(boost::csbl::get<0>(res).get() == 123);
BOOST_TEST(boost::csbl::get<1>(res).get() == 321);
}
-#if ! defined BOOST_NO_CXX11_DECLTYPE_N3276
+#if defined BOOST_THREAD_PROVIDES_VARIADIC_THREAD
// fixme darwin-4.8.0_11 terminate called without an active exception
{ // deferred future copy-constructible
boost::future<int> f1 = boost::async(boost::launch::deferred, &p1);
diff --git a/libs/thread/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp b/libs/thread/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp
index 96e8e268d7..ec31019216 100644
--- a/libs/thread/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp
+++ b/libs/thread/test/sync/mutual_exclusion/deque_views/single_thread_pass.cpp
@@ -21,9 +21,9 @@
class non_copyable
{
- BOOST_THREAD_MOVABLE_ONLY(non_copyable)
int val;
public:
+ BOOST_THREAD_MOVABLE_ONLY(non_copyable)
non_copyable(int v) : val(v){}
non_copyable(BOOST_RV_REF(non_copyable) x): val(x.val) {}
non_copyable& operator=(BOOST_RV_REF(non_copyable) x) { val=x.val; return *this; }
diff --git a/libs/thread/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp b/libs/thread/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp
index 41cf1cf3a2..d40c115788 100644
--- a/libs/thread/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp
+++ b/libs/thread/test/sync/mutual_exclusion/queue_views/single_thread_pass.cpp
@@ -21,9 +21,9 @@
class non_copyable
{
- BOOST_THREAD_MOVABLE_ONLY(non_copyable)
int val;
public:
+ BOOST_THREAD_MOVABLE_ONLY(non_copyable)
non_copyable(int v) : val(v){}
non_copyable(BOOST_RV_REF(non_copyable) x): val(x.val) {}
non_copyable& operator=(BOOST_RV_REF(non_copyable) x) { val=x.val; return *this; }