|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51113 - sandbox/interthreads/boost/interthreads/algorithm
From: vicente.botet_at_[hidden]
Date: 2009-02-08 16:26:47
Author: viboes
Date: 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
New Revision: 51113
URL: http://svn.boost.org/trac/boost/changeset/51113
Log:
interthreads version 0.4
* New free functions for all the AsynchronousCompletionToken operations, providing a higher degree of freedom.
* Missing have_all_values(), have_all_exception() and are_all_ready() functions on AsynchronousCompletionToken fusion tuples.
* get_all: getting all the values from a tuple of AsynchronousCompletionToken works now.
* fork_after overloaded for a single dependency
* wait_all overloaded for a single ACT.
* wait_for_all evaluate one of its elements on the current thread
* No need to use wait_and_get() on thread_specific_shared_ptr<> to synchronize with the decoration if the thread is created using a AsynchronousExecutor decorator. In this case the synchro is done before returning the AsynchronousCompletionToken. See the tutorial and the mono_thread_id example.
Added:
sandbox/interthreads/boost/interthreads/algorithm/are_all_joinable.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/are_all_ready.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/detach.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/get.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/get_until.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/has_exception.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/has_value.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/have_all_exception.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/have_all_value.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/interrupt.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/interruption_requested.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/is_ready.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/join.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/join_until.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/joinable.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/wait.hpp (contents, props changed)
sandbox/interthreads/boost/interthreads/algorithm/wait_until.hpp (contents, props changed)
Added: sandbox/interthreads/boost/interthreads/algorithm/are_all_joinable.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/are_all_joinable.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,50 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_INTERRUPTION_REQUESTED_ON_ALL__HPP
+#define BOOST_INTERTHREADS_INTERRUPTION_REQUESTED_ON_ALL__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/interthreads/algorithm/joinable.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace interthreads {
+
+ namespace fct {
+ struct joinable {
+ typedef bool result_type;
+
+ template<typename ACT>
+ bool operator()(ACT& act) const {
+ return interthreads::joinable(act);
+ }
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence>
+ struct are_all_joinable {
+ typedef typename fusion::result_of::all<Sequence, fct::joinable>::type type;
+ };
+ }
+
+ template <typename Sequence>
+ bool are_all_joinable(Sequence& t) {
+ return fusion::all(t, joinable);
+ }
+
+
+}} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/are_all_ready.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/are_all_ready.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,50 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_ARE_ALL_READY__HPP
+#define BOOST_INTERTHREADS_ARE_ALL_READY__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/interthreads/algorithm/is_ready.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace fct {
+ struct is_ready {
+ typedef bool result_type;
+
+ template<typename ACT>
+ bool operator()(ACT& act) const {
+ return interthreads::is_ready(act);
+ }
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence> struct are_all_ready {
+ typedef typename fusion::result_of::all<Sequence, fct::is_ready>::type type;
+ };
+ }
+
+ template <typename Sequence> bool are_all_ready(Sequence& t) {
+ return fusion::all(t, fct::is_ready());
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/detach.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/detach.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,60 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_DETACH__HPP
+#define BOOST_INTERTHREADS_DETACH__HPP
+
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT> struct detach {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct detach {
+ static typename result_of::template detach<ACT>::type apply( ACT& act ) {
+ return act.detach();
+ }
+ };
+
+ template <typename ACT> struct detach<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template detach<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->detach();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,void>::type
+ detach(ACT& act) {
+ return partial_specialization_workaround::detach<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,void>::type
+ detach(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::detach<boost::detail::thread_move_t<ACT> >::apply(act);
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/get.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/get.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,71 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_GET__HPP
+#define BOOST_INTERTHREADS_GET__HPP
+
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/fusion/include/zip_view.hpp>
+#include <boost/fusion/include/transform.hpp>
+#include <boost/fusion/include/as_vector.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT> struct get {
+ typedef typename act_traits<ACT>::move_dest_type type;
+ };
+ template <typename ACT> struct get<boost::detail::thread_move_t<ACT> > {
+ typedef typename act_traits<ACT>::move_dest_type type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct get {
+ static typename result_of::template get<ACT>::type apply( ACT& act ) {
+ return act.get();
+ }
+ };
+
+ template <typename ACT> struct get<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template get<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->get();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template get<ACT>::type
+ >::type
+ get(ACT& act) {
+ return partial_specialization_workaround::get<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template get<ACT>::type
+ >::type
+ get(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::get<ACT>::apply(act);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/get_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/get_until.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,85 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_GET_UNTIL__HPP
+#define BOOST_INTERTHREADS_GET_UNTIL__HPP
+
+#include <boost/fusion/include/transform.hpp>
+#include <boost/fusion/include/size.hpp>
+#include <boost/fusion/include/at_c.hpp>
+#include <boost/fusion/include/pop_front.hpp>
+#include <boost/fusion/include/push_front.hpp>
+#include <utility>
+#include <boost/utility/enable_if.hpp>
+
+#ifdef BOOST_HAS_CHRONO_LIB
+#include <boost/chono/chono.hpp>
+#else
+#include <boost/thread/thread_time.hpp>
+#endif
+#include <boost/interthreads/algorithm/wait_until.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct get_until {
+ typedef typename act_traits<ACT>::move_dest_type type;
+ };
+ }
+
+ namespace result_of {
+ template <typename ACT, typename Duration>
+ struct get_for {
+ typedef typename act_traits<ACT>::move_dest_type type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct get_until {
+ static typename result_of::template get_until<ACT>::type apply( ACT& act, const system_time& abs_time ) {
+ interthreads::wait_until(act, abs_time);
+ return act.get();
+ }
+ };
+ template< typename ACT, typename Duration>
+ struct get_for {
+ static typename result_of::template get_for<ACT,Duration>::type apply( ACT& act, Duration rel_time ) {
+ interthreads::wait_for(act, rel_time);
+ return act.get();
+ }
+ };
+ }
+
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template get_until<ACT>::type
+ >::type get_until(ACT& act, const system_time& abs_time) {
+ return partial_specialization_workaround::get_until<ACT>::apply(act, abs_time);
+ }
+
+ template <typename ACT, typename Duration>
+ typename boost::enable_if<has_future_if<ACT>,typename result_of::template get_for<ACT,Duration>::type >::type
+ get_for(ACT& act, Duration rel_time) {
+ return partial_specialization_workaround::get_for<ACT, Duration>::apply(act, rel_time);
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/has_exception.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/has_exception.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_HAS_EXCEPTION__HPP
+#define BOOST_INTERTHREADS_HAS_EXCEPTION__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT> struct has_exception {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct has_exception {
+ static typename result_of::has_exception<ACT>::type apply( ACT& act ) {
+ return act.has_exception();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template is_ready<ACT>::type
+ >::type has_exception(ACT& act) {
+ return partial_specialization_workaround::has_exception<ACT>::apply(act);
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/has_value.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/has_value.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_HAS_VALUE__HPP
+#define BOOST_INTERTHREADS_HAS_VALUE__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT> struct has_value {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct has_value {
+ static typename result_of::has_value<ACT>::type apply( ACT& act ) {
+ return act.has_value();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template is_ready<ACT>::type
+ >::type has_value(ACT& act) {
+ return partial_specialization_workaround::has_value<ACT>::apply(act);
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/have_all_exception.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/have_all_exception.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_HAVE_ALL_EXCEPTION__HPP
+#define BOOST_INTERTHREADS_HAVE_ALL_EXCEPTION__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/interthreads/algorithm/has_exception.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost { namespace interthreads {
+
+ namespace fct {
+ struct has_exception {
+ typedef bool result_type;
+
+ template<typename ACT>
+ bool operator()(ACT& act) const {
+ return interthreads::has_exception(act);
+ }
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence> struct have_all_exception {
+ typedef typename fusion::result_of::all<Sequence, fct::has_exception>::type type;
+ };
+ }
+
+ template <typename Sequence> bool have_all_exception(Sequence& t) {
+ return fusion::all(t, fct::has_exception());
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/have_all_value.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/have_all_value.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_HAVE_ALL_VALUE__HPP
+#define BOOST_INTERTHREADS_HAVE_ALL_VALUE__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/interthreads/algorithm/has_value.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace fct {
+ struct has_value {
+ typedef bool result_type;
+
+ template<typename ACT> bool operator()(ACT& act) const {
+ return interthreads::has_value(act);
+ }
+ };
+ }
+
+ namespace result_of {
+ template <typename Sequence> struct have_all_value {
+ typedef typename fusion::result_of::all<Sequence, fct::has_value>::type type;
+ };
+ }
+
+ template <typename Sequence> bool have_all_value(Sequence& t) {
+ return fusion::all(t, fct::has_value());
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/interrupt.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/interrupt.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,65 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_INTERRUPT__HPP
+#define BOOST_INTERTHREADS_INTERRUPT__HPP
+
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct interrupt {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct interrupt {
+ static typename result_of::template interrupt<ACT>::type apply( ACT& act ) {
+ return act.interrupt();
+ }
+ };
+ template< typename ACT >
+ struct interrupt<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template interrupt<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->interrupt();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ void
+ >::type
+ interrupt(ACT& act) {
+ return partial_specialization_workaround::interrupt<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ void
+ >::type
+ interrupt(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::interrupt<boost::detail::thread_move_t<ACT> >::apply(act);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/interruption_requested.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/interruption_requested.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,65 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_INTERRUPTION_REQUESTED__HPP
+#define BOOST_INTERTHREADS_INTERRUPTION_REQUESTED__HPP
+
+#include <boost/fusion/include/all.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+ namespace boost {
+ namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct interruption_requested {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct interruption_requested {
+ static typename result_of::template interruption_requested<ACT>::type apply( ACT& act ) {
+ return act.interruption_requested();
+ }
+ };
+ template< typename ACT >
+ struct interruption_requested<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template interruption_requested<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->interruption_requested();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ bool
+ >::type
+ interruption_requested(ACT& act) {
+ return partial_specialization_workaround::interruption_requested<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ bool
+ >::type
+ interruption_requested(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::interruption_requested<boost::detail::thread_move_t<ACT> >::apply(act);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/is_ready.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/is_ready.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_IS_READY__HPP
+#define BOOST_INTERTHREADS_IS_READY__HPP
+
+#include <boost/fusion/include/all.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT> struct is_ready {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct is_ready {
+ static typename result_of::is_ready<ACT>::type apply( ACT& act ) {
+ return act.is_ready();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template is_ready<ACT>::type
+ >::type is_ready(ACT& act) {
+ return partial_specialization_workaround::is_ready<ACT>::apply(act);
+ }
+
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/join.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/join.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,71 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_JOIN__HPP
+#define BOOST_INTERTHREADS_JOIN__HPP
+
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#ifdef BOOST_HAS_CHRONO_LIB
+#include <boost/chono/chono.hpp>
+#else
+#include <boost/thread/thread_time.hpp>
+#endif
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct join {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct join {
+ static typename result_of::template join<ACT>::type apply( ACT& act ) {
+ return act.join();
+ }
+ };
+ template< typename ACT >
+ struct join<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template join<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->join();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template join<ACT>::type
+ >::type
+ join(ACT& act) {
+ return partial_specialization_workaround::join<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template join<ACT>::type
+ >::type
+ join(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::join<boost::detail::thread_move_t<ACT> >::apply(act);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/join_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/join_until.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,108 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_JOIN_UNTIL__HPP
+#define BOOST_INTERTHREADS_JOIN_UNTIL__HPP
+
+#include <boost/fusion/include/transform.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#ifdef BOOST_HAS_CHRONO_LIB
+#include <boost/chono/chono.hpp>
+#else
+#include <boost/thread/thread_time.hpp>
+#endif
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct join_until {
+ typedef bool type;
+ };
+ }
+ namespace result_of {
+ template <typename ACT, typename Duration>
+ struct join_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct join_until {
+ static typename result_of::template join_until<ACT>::type apply( ACT& act, const system_time& abs_time ) {
+ return act.join_until(abs_time);
+ }
+ };
+
+ template< typename ACT >
+ struct join_until<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template join_until<ACT>::type apply( boost::detail::thread_move_t<ACT> act, const system_time& abs_time ) {
+ return act->join_until(abs_time);
+ }
+ };
+
+ template< typename ACT, typename Duration>
+ struct join_for {
+ static typename result_of::template join_for<ACT,Duration>::type apply( ACT& act, Duration abs_time ) {
+ return act.join_for(abs_time);
+ }
+ };
+
+ template< typename ACT, typename Duration>
+ struct join_for<boost::detail::thread_move_t<ACT>,Duration > {
+ static typename result_of::template join_for<ACT,Duration>::type apply( boost::detail::thread_move_t<ACT> act, Duration abs_time ) {
+ return act->join_for(abs_time);
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template join_until<ACT>::type
+ >::type
+ join_until(ACT& act, const system_time& abs_time) {
+ return partial_specialization_workaround::join_until<ACT>::apply(act, abs_time);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template join_until<ACT>::type
+ >::type
+ join_until(boost::detail::thread_move_t<ACT> act, const system_time& abs_time) {
+ return partial_specialization_workaround::join_until<boost::detail::thread_move_t<ACT> >::apply(act, abs_time);
+ }
+
+ template <typename ACT, typename Duration>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template join_for<ACT,Duration>::type
+ >::type
+ join_for(ACT& act, const Duration& rel_time) {
+ return partial_specialization_workaround::join_for<ACT,Duration>::apply(act, rel_time);
+ }
+
+ template <typename ACT, typename Duration>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template join_for<ACT,Duration>::type
+ >::type
+ join_for(boost::detail::thread_move_t<ACT> act, const Duration& rel_time) {
+ return partial_specialization_workaround::join_for<boost::detail::thread_move_t<ACT>,Duration>::apply(act, rel_time);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/joinable.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/joinable.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,61 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_JOINABLE__HPP
+#define BOOST_INTERTHREADS_JOINABLE__HPP
+
+#include <boost/fusion/include/all.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct joinable {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template <typename ACT> struct joinable {
+ static typename result_of::template joinable<ACT>::type apply( ACT& act ) {
+ return act.joinable();
+ }
+ };
+ template <typename ACT> struct joinable<boost::detail::thread_move_t<ACT> >{
+ static typename result_of::template joinable<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->joinable();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template joinable<ACT>::type
+ >::type joinable(ACT& act) {
+ return partial_specialization_workaround::joinable<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_thread_if<ACT>,
+ typename result_of::template joinable<ACT>::type
+ >::type joinable(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::joinable<boost::detail::thread_move_t<ACT> >::apply(act);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/wait.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/wait.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,71 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_WAIT__HPP
+#define BOOST_INTERTHREADS_WAIT__HPP
+
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#ifdef BOOST_HAS_CHRONO_LIB
+#include <boost/chono/chono.hpp>
+#else
+#include <boost/thread/thread_time.hpp>
+#endif
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct wait {
+ typedef void type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct wait {
+ static typename result_of::template wait<ACT>::type apply( ACT& act ) {
+ return act.wait();
+ }
+ };
+ template< typename ACT >
+ struct wait<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template wait<ACT>::type apply( boost::detail::thread_move_t<ACT> act ) {
+ return act->wait();
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template wait<ACT>::type
+ >::type
+ wait(ACT& act) {
+ return partial_specialization_workaround::wait<ACT>::apply(act);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template wait<ACT>::type
+ >::type
+ wait(boost::detail::thread_move_t<ACT> act) {
+ return partial_specialization_workaround::wait<boost::detail::thread_move_t<ACT> >::apply(act);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Added: sandbox/interthreads/boost/interthreads/algorithm/wait_until.hpp
==============================================================================
--- (empty file)
+++ sandbox/interthreads/boost/interthreads/algorithm/wait_until.hpp 2009-02-08 16:26:46 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,106 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2008-2009. 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)
+//
+// See http://www.boost.org/libs/interthreads for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTERTHREADS_WAIT_UNTIL__HPP
+#define BOOST_INTERTHREADS_WAIT_UNTIL__HPP
+
+#include <boost/fusion/include/transform.hpp>
+#include <boost/utility/enable_if.hpp>
+
+#ifdef BOOST_HAS_CHRONO_LIB
+#include <boost/chono/chono.hpp>
+#else
+#include <boost/thread/thread_time.hpp>
+#endif
+
+#include <boost/config/abi_prefix.hpp>
+
+namespace boost {
+namespace interthreads {
+
+ namespace result_of {
+ template <typename ACT>
+ struct wait_until {
+ typedef bool type;
+ };
+ }
+
+ namespace result_of {
+ template <typename ACT, typename Duration>
+ struct wait_for {
+ typedef bool type;
+ };
+ }
+
+ namespace partial_specialization_workaround {
+ template< typename ACT >
+ struct wait_until {
+ static typename result_of::template wait_until<ACT>::type apply( ACT& act, const system_time& abs_time ) {
+ return act.wait_until(abs_time);
+ }
+ };
+ template< typename ACT >
+ struct wait_until<boost::detail::thread_move_t<ACT> > {
+ static typename result_of::template wait_until<ACT>::type apply( boost::detail::thread_move_t<ACT> act, const system_time& abs_time ) {
+ return act.wait_until(abs_time);
+ }
+ };
+ template< typename ACT, typename Duration>
+ struct wait_for {
+ static typename result_of::template wait_for<ACT,Duration>::type apply( ACT& act, Duration abs_time ) {
+ return act.wait_for(abs_time);
+ }
+ };
+ template< typename ACT, typename Duration>
+ struct wait_for<boost::detail::thread_move_t<ACT>,Duration> {
+ static typename result_of::template wait_for<ACT,Duration>::type apply( boost::detail::thread_move_t<ACT> act, Duration abs_time ) {
+ return act.wait_for(abs_time);
+ }
+ };
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template wait_until<ACT>::type
+ >::type
+ wait_until(ACT& act, const system_time& abs_time) {
+ return partial_specialization_workaround::wait_until<ACT>::apply(act, abs_time);
+ }
+
+ template <typename ACT>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::template wait_until<ACT>::type
+ >::type
+ wait_until(boost::detail::thread_move_t<ACT> act, const system_time& abs_time) {
+ return partial_specialization_workaround::wait_until<boost::detail::thread_move_t<ACT> >::apply(act, abs_time);
+ }
+
+ template <typename ACT, typename Duration>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::wait_for<ACT,Duration>::type
+ >::type
+ wait_for(ACT& act, Duration rel_time) {
+ return partial_specialization_workaround::wait_for<ACT,Duration>::apply(act, rel_time);
+ }
+
+ template <typename ACT, typename Duration>
+ typename boost::enable_if<has_future_if<ACT>,
+ typename result_of::wait_for<ACT,Duration>::type
+ >::type
+ wait_for(boost::detail::thread_move_t<ACT> act, Duration rel_time) {
+ return partial_specialization_workaround::wait_for<boost::detail::thread_move_t<ACT>,Duration>::apply(act, rel_time);
+ }
+
+}
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk