Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52593 - in sandbox/task: boost boost/task boost/task/detail libs/task/src
From: oliver.kowalke_at_[hidden]
Date: 2009-04-25 15:39:22


Author: olli
Date: 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
New Revision: 52593
URL: http://svn.boost.org/trac/boost/changeset/52593

Log:
* introduction of async and async_handle

Added:
   sandbox/task/boost/task/async.hpp (contents, props changed)
   sandbox/task/boost/task/async_handle.hpp (contents, props changed)
Removed:
   sandbox/task/boost/task/handle.hpp
   sandbox/task/boost/task/launch.hpp
Text files modified:
   sandbox/task/boost/task.hpp | 4 ++--
   sandbox/task/boost/task/detail/wsq.hpp | 12 ++++++------
   sandbox/task/boost/task/pool.hpp | 16 ++++++++--------
   sandbox/task/boost/task/semaphore.hpp | 4 ++--
   sandbox/task/boost/task/task.hpp | 2 +-
   sandbox/task/libs/task/src/semaphore_posix.cpp | 14 +++++++-------
   6 files changed, 26 insertions(+), 26 deletions(-)

Modified: sandbox/task/boost/task.hpp
==============================================================================
--- sandbox/task/boost/task.hpp (original)
+++ sandbox/task/boost/task.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -7,14 +7,14 @@
 #ifndef BOOST_TASK_H
 #define BOOST_TASK_H
 
+#include <boost/task/async.hpp>
+#include <boost/task/async_handle.hpp>
 #include <boost/task/bounded_channel.hpp>
 #include <boost/task/default_pool.hpp>
 #include <boost/task/exceptions.hpp>
 #include <boost/task/fifo.hpp>
-#include <boost/task/handle.hpp>
 #include <boost/task/id.hpp>
 #include <boost/task/info.hpp>
-#include <boost/task/launch.hpp>
 #include <boost/task/lifo.hpp>
 #include <boost/task/pool.hpp>
 #include <boost/task/poolsize.hpp>

Added: sandbox/task/boost/task/async.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/async.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -0,0 +1,69 @@
+
+// Copyright Oliver Kowalke 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)
+
+#ifndef BOOST_TASK_ASYNC_H
+#define BOOST_TASK_ASYNC_H
+
+#include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
+
+#include <boost/task/default_pool.hpp>
+#include <boost/task/detail/interrupter.hpp>
+#include <boost/task/detail/thread_callable.hpp>
+#include <boost/task/async_handle.hpp>
+#include <boost/task/pool.hpp>
+#include <boost/task/task.hpp>
+
+namespace boost { namespace task
+{
+template< typename R >
+async_handle< R > async_pool( task< R > t)
+{ return get_default_pool().submit( t); }
+
+template<
+ typename R,
+ typename Attr
+>
+async_handle< R > async_pool(
+ task< R > t,
+ Attr const& attr)
+{ return get_default_pool().submit( t, attr); }
+
+template<
+ typename Channel,
+ typename R
+>
+async_handle< R > async_pool(
+ pool< Channel > & pool,
+ task< R > t)
+{ return pool.submit( t); }
+
+template<
+ typename Channel,
+ typename R,
+ typename Attr
+>
+async_handle< R > async_pool(
+ pool< Channel > & pool,
+ task< R > t,
+ Attr const& attr)
+{ return pool.submit( t, attr); }
+
+
+template< typename R >
+async_handle< R > async_thread( task< R > t)
+{
+ detail::interrupter intr;
+ detail::thread_callable ca( t, intr);
+
+ shared_ptr< thread > thrd( new thread( ca) );
+ ca.set( thrd);
+
+ return async_handle< R >( t.get_id(), t.get_future(), intr);
+}
+} }
+
+#endif // BOOST_TASK_ASYNC_H

Added: sandbox/task/boost/task/async_handle.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/async_handle.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -0,0 +1,287 @@
+
+// Copyright Oliver Kowalke 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)
+
+#ifndef BOOST_TASK_ASYNC_HANDLE_H
+#define BOOST_TASK_ASYNC_HANDLE_H
+
+#include <boost/thread.hpp>
+#include <boost/thread/thread_time.hpp>
+
+#include <boost/task/detail/interrupter.hpp>
+#include <boost/task/future.hpp>
+#include <boost/task/exceptions.hpp>
+#include <boost/task/id.hpp>
+
+namespace boost { namespace task
+{
+
+template< typename R >
+class async_handle;
+
+template< typename R >
+class task;
+
+template< typename Channel >
+class pool;
+
+template< typename R >
+async_handle< R > async_thread( task< R >);
+
+template< typename R >
+class async_handle
+{
+private:
+ template< typename Channel >
+ friend class pool;
+ template< typename T >
+ friend async_handle< T > async_thread( task< T >);
+ template< typename Iterator >
+ friend void waitfor_all( Iterator begin, Iterator end);
+ template< typename T1, typename T2 >
+ friend void waitfor_all( T1 & t1, T2 & t2);
+ template< typename T1, typename T2, typename T3 >
+ friend void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3);
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4);
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4, async_handle< T5 > & t5);
+ template< typename Iterator >
+ friend Iterator waitfor_any( Iterator begin, Iterator end);
+ template< typename T1, typename T2 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2);
+ template< typename T1, typename T2, typename T3 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3);
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4);
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4, async_handle< T5 > & t5);
+
+ shared_future< R > fut_;
+ detail::interrupter intr_;
+ id id_;
+
+ async_handle(
+ id const& id__,
+ shared_future< R > const& fut,
+ detail::interrupter const& intr)
+ :
+ fut_( fut),
+ intr_( intr),
+ id_( id__)
+ {}
+
+public:
+ async_handle()
+ : fut_(), intr_(), id_()
+ {}
+
+ const id get_id() const
+ { return id_; }
+
+ void interrupt()
+ { intr_.interrupt(); }
+
+ void interrupt_and_wait()
+ { intr_.interrupt_and_wait(); }
+
+ void interrupt_and_wait( system_time const& abs_time)
+ { intr_.interrupt_and_wait( abs_time); }
+
+ template< typename Duration >
+ void interrupt_and_wait( Duration const& rel_time)
+ { intr_.interrupt_and_wait( rel_time); }
+
+ bool interruption_requested()
+ { return intr_.interruption_requested(); }
+
+ R get()
+ {
+ try
+ { return fut_.get(); }
+ catch ( broken_promise const&)
+ { throw broken_task(); }
+ }
+
+ bool is_ready() const
+ { return fut_.is_ready(); }
+
+ bool has_value() const
+ { return fut_.has_value(); }
+
+ bool has_exception() const
+ { return fut_.has_exception(); }
+
+ void wait() const
+ { fut_.wait(); }
+
+ template< typename Duration >
+ bool timed_wait( Duration const& rel_time) const
+ { return fut_.timed_wait( rel_time); }
+
+ bool timed_wait_until( system_time const& abs_time) const
+ { return fut_.timed_wait_until( abs_time); }
+
+ void swap( async_handle< R > & other)
+ {
+ fut_.swap( other.fut_);
+ intr_.swap( other.intr_);
+ id_.swap( other.id_);
+ }
+};
+
+template<>
+class async_handle< void >
+{
+private:
+ template< typename Channel >
+ friend class pool;
+ template< typename T >
+ friend async_handle< T > async_thread( task< T >);
+ template< typename Iterator >
+ friend void waitfor_all( Iterator begin, Iterator end);
+ template< typename T1, typename T2 >
+ friend void waitfor_all( T1 & t1, T2 & t2);
+ template< typename T1, typename T2, typename T3 >
+ friend void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3);
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4);
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4, async_handle< T5 > & t5);
+ template< typename Iterator >
+ friend Iterator waitfor_any( Iterator begin, Iterator end);
+ template< typename T1, typename T2 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2);
+ template< typename T1, typename T2, typename T3 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3);
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4);
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4, async_handle< T5 > & t5);
+
+ shared_future< void > fut_;
+ detail::interrupter intr_;
+ id id_;
+
+ async_handle(
+ shared_future< void > const& fut,
+ detail::interrupter const& intr,
+ id const& id__)
+ :
+ fut_( fut),
+ intr_( intr),
+ id_( id__)
+ {}
+
+
+public:
+ async_handle()
+ : fut_(), intr_(), id_()
+ {}
+
+ const id get_id() const
+ { return id_; }
+
+ void interrupt()
+ { intr_.interrupt(); }
+
+ void interrupt_and_wait()
+ { intr_.interrupt_and_wait(); }
+
+ void interrupt_and_wait( system_time const& abs_time)
+ { intr_.interrupt_and_wait( abs_time); }
+
+ template< typename Duration >
+ void interrupt_and_wait( Duration const& rel_time)
+ { intr_.interrupt_and_wait( rel_time); }
+
+ bool interruption_requested()
+ { return intr_.interruption_requested(); }
+
+ void get()
+ {
+ try
+ { fut_.get(); }
+ catch ( broken_promise const&)
+ { throw broken_task(); }
+ }
+
+ bool is_ready() const
+ { return fut_.is_ready(); }
+
+ bool has_value() const
+ { return fut_.has_value(); }
+
+ bool has_exception() const
+ { return fut_.has_exception(); }
+
+ void wait() const
+ { fut_.wait(); }
+
+ template< typename Duration >
+ bool timed_wait( Duration const& rel_time) const
+ { return fut_.timed_wait( rel_time); }
+
+ bool timed_wait_until( system_time const& abs_time) const
+ { return fut_.timed_wait_until( abs_time); }
+
+ void swap( async_handle< void > & other)
+ {
+ fut_.swap( other.fut_);
+ intr_.swap( other.intr_);
+ }
+};
+
+template< typename Iterator >
+void waitfor_all( Iterator begin, Iterator end)
+{
+ for ( Iterator i = begin; i != end; ++i)
+ i->wait();
+}
+
+template< typename T1, typename T2 >
+void waitfor_all( T1 & t1, T2 & t2)
+{ wait_for_all( t1.fut_, t2.fut_); }
+
+template< typename T1, typename T2, typename T3 >
+void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3)
+{ wait_for_all( t1.fut_, t2.fut_, t3.fut_); }
+
+template< typename T1, typename T2, typename T3, typename T4 >
+void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4)
+{ wait_for_all( t1.fut_, t2.fut_, t3.fut_, t4.fut_); }
+
+template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+void waitfor_all( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4, async_handle< T5 > & t5)
+{ wait_for_all( t1.fut_, t2.fut_, t3.fut_, t4.fut_, t5.fut_); }
+
+template< typename Iterator >
+Iterator waitfor_any( Iterator begin, Iterator end)
+{
+ boost::detail::future_waiter waiter;
+ for ( Iterator i = begin; i != end; ++i)
+ waiter.add( i->fut_);
+ return next( begin, waiter.wait() );
+}
+
+template< typename T1, typename T2 >
+unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2)
+{ return wait_for_any( t1.fut_, t2.fut_); }
+
+template< typename T1, typename T2, typename T3 >
+unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3)
+{ return wait_for_any( t1.fut_, t2.fut_, t3.fut_); }
+
+template< typename T1, typename T2, typename T3, typename T4 >
+unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4)
+{ return wait_for_any( t1.fut_, t2.fut_, t3.fut_, t4.fut_); }
+
+template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+unsigned int waitfor_any( async_handle< T1 > & t1, async_handle< T2 > & t2, async_handle< T3 > & t3, async_handle< T4 > & t4, async_handle< T5 > & t5)
+{ return wait_for_any( t1.fut_, t2.fut_, t3.fut_, t4.fut_, t5.fut_); }
+
+}}
+
+#endif // BOOST_TASK_ASYNC_HANDLE_H

Modified: sandbox/task/boost/task/detail/wsq.hpp
==============================================================================
--- sandbox/task/boost/task/detail/wsq.hpp (original)
+++ sandbox/task/boost/task/detail/wsq.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -24,13 +24,13 @@
 class BOOST_TASK_DECL wsq : private noncopyable
 {
 private:
- const int initial_size_;
+ const int initial_size_;
         shared_array< pool_callable > array_;
- int capacity_;
- int mask_;
- volatile uint32_t head_idx_;
- volatile uint32_t tail_idx_;
- recursive_mutex mtx_;
+ int capacity_;
+ int mask_;
+ volatile uint32_t head_idx_;
+ volatile uint32_t tail_idx_;
+ recursive_mutex mtx_;
 
 public:
         wsq();

Deleted: sandbox/task/boost/task/handle.hpp
==============================================================================
--- sandbox/task/boost/task/handle.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
+++ (empty file)
@@ -1,287 +0,0 @@
-
-// Copyright Oliver Kowalke 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)
-
-#ifndef BOOST_TASK_HANDLE_H
-#define BOOST_TASK_HANDLE_H
-
-#include <boost/thread.hpp>
-#include <boost/thread/thread_time.hpp>
-
-#include <boost/task/detail/interrupter.hpp>
-#include <boost/task/future.hpp>
-#include <boost/task/exceptions.hpp>
-#include <boost/task/id.hpp>
-
-namespace boost { namespace task
-{
-
-template< typename R >
-class handle;
-
-template< typename R >
-class task;
-
-template< typename Channel >
-class pool;
-
-template< typename R >
-handle< R > launch_in_thread( task< R >);
-
-template< typename R >
-class handle
-{
-private:
- template< typename Channel >
- friend class pool;
- template< typename T >
- friend handle< T > launch_in_thread( task< T >);
- template< typename Iterator >
- friend void waitfor_all( Iterator begin, Iterator end);
- template< typename T1, typename T2 >
- friend void waitfor_all( T1 & t1, T2 & t2);
- template< typename T1, typename T2, typename T3 >
- friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
- template< typename T1, typename T2, typename T3, typename T4 >
- friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
- template< typename T1, typename T2, typename T3, typename T4, typename T5 >
- friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
- template< typename Iterator >
- friend Iterator waitfor_any( Iterator begin, Iterator end);
- template< typename T1, typename T2 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2);
- template< typename T1, typename T2, typename T3 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
- template< typename T1, typename T2, typename T3, typename T4 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
- template< typename T1, typename T2, typename T3, typename T4, typename T5 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
-
- shared_future< R > fut_;
- detail::interrupter intr_;
- id id_;
-
- handle(
- id const& id__,
- shared_future< R > const& fut,
- detail::interrupter const& intr)
- :
- fut_( fut),
- intr_( intr),
- id_( id__)
- {}
-
-public:
- handle()
- : fut_(), intr_(), id_()
- {}
-
- const id get_id() const
- { return id_; }
-
- void interrupt()
- { intr_.interrupt(); }
-
- void interrupt_and_wait()
- { intr_.interrupt_and_wait(); }
-
- void interrupt_and_wait( system_time const& abs_time)
- { intr_.interrupt_and_wait( abs_time); }
-
- template< typename Duration >
- void interrupt_and_wait( Duration const& rel_time)
- { intr_.interrupt_and_wait( rel_time); }
-
- bool interruption_requested()
- { return intr_.interruption_requested(); }
-
- R get()
- {
- try
- { return fut_.get(); }
- catch ( broken_promise const&)
- { throw broken_task(); }
- }
-
- bool is_ready() const
- { return fut_.is_ready(); }
-
- bool has_value() const
- { return fut_.has_value(); }
-
- bool has_exception() const
- { return fut_.has_exception(); }
-
- void wait() const
- { fut_.wait(); }
-
- template< typename Duration >
- bool timed_wait( Duration const& rel_time) const
- { return fut_.timed_wait( rel_time); }
-
- bool timed_wait_until( system_time const& abs_time) const
- { return fut_.timed_wait_until( abs_time); }
-
- void swap( handle< R > & other)
- {
- fut_.swap( other.fut_);
- intr_.swap( other.intr_);
- id_.swap( other.id_);
- }
-};
-
-template<>
-class handle< void >
-{
-private:
- template< typename Channel >
- friend class pool;
- template< typename T >
- friend handle< T > launch_in_thread( task< T >);
- template< typename Iterator >
- friend void waitfor_all( Iterator begin, Iterator end);
- template< typename T1, typename T2 >
- friend void waitfor_all( T1 & t1, T2 & t2);
- template< typename T1, typename T2, typename T3 >
- friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
- template< typename T1, typename T2, typename T3, typename T4 >
- friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
- template< typename T1, typename T2, typename T3, typename T4, typename T5 >
- friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
- template< typename Iterator >
- friend Iterator waitfor_any( Iterator begin, Iterator end);
- template< typename T1, typename T2 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2);
- template< typename T1, typename T2, typename T3 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
- template< typename T1, typename T2, typename T3, typename T4 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
- template< typename T1, typename T2, typename T3, typename T4, typename T5 >
- friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
-
- shared_future< void > fut_;
- detail::interrupter intr_;
- id id_;
-
- handle(
- shared_future< void > const& fut,
- detail::interrupter const& intr,
- id const& id__)
- :
- fut_( fut),
- intr_( intr),
- id_( id__)
- {}
-
-
-public:
- handle()
- : fut_(), intr_(), id_()
- {}
-
- const id get_id() const
- { return id_; }
-
- void interrupt()
- { intr_.interrupt(); }
-
- void interrupt_and_wait()
- { intr_.interrupt_and_wait(); }
-
- void interrupt_and_wait( system_time const& abs_time)
- { intr_.interrupt_and_wait( abs_time); }
-
- template< typename Duration >
- void interrupt_and_wait( Duration const& rel_time)
- { intr_.interrupt_and_wait( rel_time); }
-
- bool interruption_requested()
- { return intr_.interruption_requested(); }
-
- void get()
- {
- try
- { fut_.get(); }
- catch ( broken_promise const&)
- { throw broken_task(); }
- }
-
- bool is_ready() const
- { return fut_.is_ready(); }
-
- bool has_value() const
- { return fut_.has_value(); }
-
- bool has_exception() const
- { return fut_.has_exception(); }
-
- void wait() const
- { fut_.wait(); }
-
- template< typename Duration >
- bool timed_wait( Duration const& rel_time) const
- { return fut_.timed_wait( rel_time); }
-
- bool timed_wait_until( system_time const& abs_time) const
- { return fut_.timed_wait_until( abs_time); }
-
- void swap( handle< void > & other)
- {
- fut_.swap( other.fut_);
- intr_.swap( other.intr_);
- }
-};
-
-template< typename Iterator >
-void waitfor_all( Iterator begin, Iterator end)
-{
- for ( Iterator i = begin; i != end; ++i)
- i->wait();
-}
-
-template< typename T1, typename T2 >
-void waitfor_all( T1 & t1, T2 & t2)
-{ wait_for_all( t1.fut_, t2.fut_); }
-
-template< typename T1, typename T2, typename T3 >
-void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3)
-{ wait_for_all( t1.fut_, t2.fut_, t3.fut_); }
-
-template< typename T1, typename T2, typename T3, typename T4 >
-void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4)
-{ wait_for_all( t1.fut_, t2.fut_, t3.fut_, t4.fut_); }
-
-template< typename T1, typename T2, typename T3, typename T4, typename T5 >
-void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5)
-{ wait_for_all( t1.fut_, t2.fut_, t3.fut_, t4.fut_, t5.fut_); }
-
-template< typename Iterator >
-Iterator waitfor_any( Iterator begin, Iterator end)
-{
- boost::detail::future_waiter waiter;
- for ( Iterator i = begin; i != end; ++i)
- waiter.add( i->fut_);
- return next( begin, waiter.wait() );
-}
-
-template< typename T1, typename T2 >
-unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2)
-{ return wait_for_any( t1.fut_, t2.fut_); }
-
-template< typename T1, typename T2, typename T3 >
-unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3)
-{ return wait_for_any( t1.fut_, t2.fut_, t3.fut_); }
-
-template< typename T1, typename T2, typename T3, typename T4 >
-unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4)
-{ return wait_for_any( t1.fut_, t2.fut_, t3.fut_, t4.fut_); }
-
-template< typename T1, typename T2, typename T3, typename T4, typename T5 >
-unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5)
-{ return wait_for_any( t1.fut_, t2.fut_, t3.fut_, t4.fut_, t5.fut_); }
-
-}}
-
-#endif // BOOST_TASK_HANDLE_H

Deleted: sandbox/task/boost/task/launch.hpp
==============================================================================
--- sandbox/task/boost/task/launch.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
+++ (empty file)
@@ -1,69 +0,0 @@
-
-// Copyright Oliver Kowalke 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)
-
-#ifndef BOOST_TASK_LAUNCH_H
-#define BOOST_TASK_LAUNCH_H
-
-#include <boost/shared_ptr.hpp>
-#include <boost/thread.hpp>
-
-#include <boost/task/default_pool.hpp>
-#include <boost/task/detail/interrupter.hpp>
-#include <boost/task/detail/thread_callable.hpp>
-#include <boost/task/handle.hpp>
-#include <boost/task/pool.hpp>
-#include <boost/task/task.hpp>
-
-namespace boost { namespace task
-{
-template< typename R >
-handle< R > launch_in_pool( task< R > t)
-{ return get_default_pool().submit( t); }
-
-template<
- typename R,
- typename Attr
->
-handle< R > launch_in_pool(
- task< R > t,
- Attr const& attr)
-{ return get_default_pool().submit( t, attr); }
-
-template<
- typename Channel,
- typename R
->
-handle< R > launch_in_pool(
- pool< Channel > & pool,
- task< R > t)
-{ return pool.submit( t); }
-
-template<
- typename Channel,
- typename R,
- typename Attr
->
-handle< R > launch_in_pool(
- pool< Channel > & pool,
- task< R > t,
- Attr const& attr)
-{ return pool.submit( t, attr); }
-
-
-template< typename R >
-handle< R > launch_in_thread( task< R > t)
-{
- detail::interrupter intr;
- detail::thread_callable ca( t, intr);
-
- shared_ptr< thread > thrd( new thread( ca) );
- ca.set( thrd);
-
- return handle< R >( t.get_id(), t.get_future(), intr);
-}
-} }
-
-#endif // BOOST_TASK_LAUNCH_H

Modified: sandbox/task/boost/task/pool.hpp
==============================================================================
--- sandbox/task/boost/task/pool.hpp (original)
+++ sandbox/task/boost/task/pool.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -14,8 +14,8 @@
 #include <boost/assert.hpp>
 #include <boost/bind.hpp>
 #include <boost/cstdint.hpp>
-#include <boost/function.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/function.hpp>
 #include <boost/thread.hpp>
 #include <boost/utility.hpp>
 
@@ -27,7 +27,7 @@
 #include <boost/task/detail/worker_group.hpp>
 #include <boost/task/exceptions.hpp>
 #include <boost/task/future.hpp>
-#include <boost/task/handle.hpp>
+#include <boost/task/async_handle.hpp>
 #include <boost/task/poolsize.hpp>
 #include <boost/task/scanns.hpp>
 #include <boost/task/task.hpp>
@@ -291,7 +291,7 @@
         { return channel_.lower_bound( lwm); }
 
         template< typename R >
- handle< R > submit( task< R > t)
+ async_handle< R > submit( task< R > t)
         {
                 detail::interrupter intr;
                 shared_future< R > fut( t.get_future() );
@@ -308,7 +308,7 @@
                                         w,
                                         wcb) );
                         w->put( detail::pool_callable( t, intr) );
- return handle< R >( t.get_id(), fut, intr);
+ return async_handle< R >( t.get_id(), fut, intr);
                 }
                 else
                 {
@@ -316,7 +316,7 @@
                                 throw task_rejected("pool is closed");
 
                         channel_.put( detail::pool_callable( t, intr) );
- return handle< R >( t.get_id(), fut, intr);
+ return async_handle< R >( t.get_id(), fut, intr);
                 }
         }
 
@@ -324,7 +324,7 @@
                 typename R,
                 typename Attr
>
- handle< R > submit( task< R > t, Attr const& attr)
+ async_handle< R > submit( task< R > t, Attr const& attr)
         {
                 detail::interrupter intr;
                 shared_future< R > fut( t.get_future() );
@@ -341,7 +341,7 @@
                                         w,
                                         wcb) );
                         w->put( detail::pool_callable( t, intr) );
- return handle< R >( t.get_id(), fut, intr);
+ return async_handle< R >( t.get_id(), fut, intr);
                 }
                 else
                 {
@@ -349,7 +349,7 @@
                                 throw task_rejected("pool is closed");
 
                         channel_.put( channel_item( detail::pool_callable( t, intr), attr) );
- return handle< R >( t.get_id(), fut, intr);
+ return async_handle< R >( t.get_id(), fut, intr);
                 }
         }
 };

Modified: sandbox/task/boost/task/semaphore.hpp
==============================================================================
--- sandbox/task/boost/task/semaphore.hpp (original)
+++ sandbox/task/boost/task/semaphore.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -30,9 +30,9 @@
 {
 private:
 # if defined(BOOST_WINDOWS_API)
- HANDLE handle_;
+ HANDLE async_handle_;
 # elif defined(BOOST_POSIX_API)
- sem_t handle_;;
+ sem_t async_handle_;;
 # endif
 public:
         semaphore( int);

Modified: sandbox/task/boost/task/task.hpp
==============================================================================
--- sandbox/task/boost/task/task.hpp (original)
+++ sandbox/task/boost/task/task.hpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -22,7 +22,7 @@
 
 #include <boost/task/future.hpp>
 #include <boost/task/exceptions.hpp>
-#include <boost/task/handle.hpp>
+#include <boost/task/async_handle.hpp>
 #include <boost/task/id.hpp>
 
 namespace boost { namespace task

Modified: sandbox/task/libs/task/src/semaphore_posix.cpp
==============================================================================
--- sandbox/task/libs/task/src/semaphore_posix.cpp (original)
+++ sandbox/task/libs/task/src/semaphore_posix.cpp 2009-04-25 15:39:21 EDT (Sat, 25 Apr 2009)
@@ -14,33 +14,33 @@
 namespace boost { namespace task
 {
 semaphore::semaphore( int value)
-: handle_()
+: async_handle_()
 {
- if ( ::sem_init( & handle_, 0, value) == -1)
+ if ( ::sem_init( & async_handle_, 0, value) == -1)
                 throw system::system_error( errno, system::system_category);
 }
 
 semaphore::~semaphore()
-{ ::sem_destroy( & handle_); }
+{ ::sem_destroy( & async_handle_); }
 
 void
 semaphore::post()
 {
- if ( ::sem_post( & handle_) == -1)
+ if ( ::sem_post( & async_handle_) == -1)
                 throw system::system_error( errno, system::system_category);
 }
 
 void
 semaphore::wait()
 {
- if ( ::sem_wait( & handle_) == -1)
+ if ( ::sem_wait( & async_handle_) == -1)
                 throw system::system_error( errno, system::system_category);
 }
 
 bool
 semaphore::try_wait()
 {
- if ( ::sem_trywait( & handle_) == -1)
+ if ( ::sem_trywait( & async_handle_) == -1)
         {
                 if ( errno == EAGAIN)
                         return false;
@@ -54,7 +54,7 @@
 semaphore::value()
 {
         int value( 0);
- if ( ::sem_getvalue( & handle_, & value) == -1)
+ if ( ::sem_getvalue( & async_handle_, & value) == -1)
                 throw system::system_error( errno, system::system_category);
         return value;
 }


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