Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54401 - in sandbox/task: . boost/task boost/task/detail libs/task/build libs/task/src libs/task/test
From: oliver.kowalke_at_[hidden]
Date: 2009-06-27 03:59:53


Author: olli
Date: 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
New Revision: 54401
URL: http://svn.boost.org/trac/boost/changeset/54401

Log:
* pool_callable renamed to callable
* thread_callable removed
* task and static_pool don't dervie from noncopyable
* move semantics corrected
* worker_group removes all worker-threads in join_all()
* interrutper simplified (no condition_variable, no reset in dtor)

Added:
   sandbox/task/boost/task/detail/callable.hpp (contents, props changed)
   sandbox/task/libs/task/src/callable.cpp (contents, props changed)
Removed:
   sandbox/task/boost/task/detail/pool_callable.hpp
   sandbox/task/boost/task/detail/thread_callable.hpp
   sandbox/task/libs/task/src/pool_callable.cpp
   sandbox/task/libs/task/src/thread_callable.cpp
Text files modified:
   sandbox/task/boost/task/as_sub_task.hpp | 11 ++-----
   sandbox/task/boost/task/async.hpp | 34 +++++-----------------
   sandbox/task/boost/task/bounded_channel.hpp | 22 +++++++-------
   sandbox/task/boost/task/detail/interrupter.hpp | 6 ++-
   sandbox/task/boost/task/detail/worker.hpp | 40 +++++++++++++-------------
   sandbox/task/boost/task/detail/worker_group.hpp | 12 +++++--
   sandbox/task/boost/task/detail/wsq.hpp | 10 +++---
   sandbox/task/boost/task/fifo.hpp | 4 +-
   sandbox/task/boost/task/new_thread.hpp | 13 +++-----
   sandbox/task/boost/task/own_thread.hpp | 7 ----
   sandbox/task/boost/task/priority.hpp | 10 +++---
   sandbox/task/boost/task/smart.hpp | 10 +++---
   sandbox/task/boost/task/static_pool.hpp | 58 +++++++++++++++------------------------
   sandbox/task/boost/task/task.hpp | 22 +++++++++-----
   sandbox/task/boost/task/unbounded_channel.hpp | 22 +++++++-------
   sandbox/task/change.log | 9 ++++++
   sandbox/task/libs/task/build/Jamfile.v2 | 4 +-
   sandbox/task/libs/task/src/interrupter.cpp | 35 +++++++++++++++--------
   sandbox/task/libs/task/src/worker.cpp | 6 ++--
   sandbox/task/libs/task/src/worker_group.cpp | 23 +++++++++++++--
   sandbox/task/libs/task/src/wsq.cpp | 10 +++---
   sandbox/task/libs/task/test/test_bounded_pool.cpp | 4 +-
   sandbox/task/libs/task/test/test_unbounded_pool.cpp | 4 +-
   23 files changed, 188 insertions(+), 188 deletions(-)

Modified: sandbox/task/boost/task/as_sub_task.hpp
==============================================================================
--- sandbox/task/boost/task/as_sub_task.hpp (original)
+++ sandbox/task/boost/task/as_sub_task.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -26,16 +26,11 @@
 struct as_sub_task
 {
         template< typename R >
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > operator()( task< R > && t_)
-# else
- handle< R > operator()( boost::detail::thread_move_t< task< R > > t_)
-# endif
+ handle< R > operator()( task< R > t)
         {
                 detail::worker * w( detail::worker::tss_get() );
                 if ( w)
                 {
- task< R > t( t_);
                         shared_future< R > fut( t.get_future() );
                         detail::interrupter intr;
                         function< bool() > wcb(
@@ -47,11 +42,11 @@
                                         ( void ( detail::worker::*)( function< bool() > const&) ) & detail::worker::reschedule_until,
                                         w,
                                         wcb) );
- w->put( detail::pool_callable( boost::move( t), intr) );
+ w->put( detail::callable( boost::move( t), intr) );
                         return handle< R >( fut, intr);
                 }
                 else
- return new_thread()( t_);
+ return new_thread()( t);
         }
 };
 } }

Modified: sandbox/task/boost/task/async.hpp
==============================================================================
--- sandbox/task/boost/task/async.hpp (original)
+++ sandbox/task/boost/task/async.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -19,39 +19,21 @@
 
 namespace boost { namespace task
 {
-# if defined(BOOST_HAS_RVALUE_REFS)
 template< typename R >
-handle< R > async( task< R > && t)
-{ return as_sub_task()( t); }
+handle< R > async( task< R > t)
+{ return as_sub_task()( boost::move( t) ); }
 
 template< typename R, typename EP >
-handle< R > async( task< R > && t, EP ep)
-{ return ep( t); }
+handle< R > async( task< R > t, EP ep)
+{ return ep( boost::move( t) ); }
 
 template< typename R, typename Channel >
-handle< R > async( task< R > && t, static_pool< Channel > & pool)
-{ return pool.submit( t); }
+handle< R > async( task< R > t, static_pool< Channel > & pool)
+{ return pool.submit( boost::move( t) ); }
 
 template< typename R, typename Channel, typename Attr >
-handle< R > async( task< R > && t, Attr attr, static_pool< Channel > & pool)
-{ return pool.submit( t, attr); }
-# else
-template< typename R >
-handle< R > async( boost::detail::thread_move_t< task< R > > t)
-{ return as_sub_task()( t); }
-
-template< typename R, typename EP >
-handle< R > async( boost::detail::thread_move_t< task< R > > t, EP ep)
-{ return ep( t); }
-
-template< typename R, typename Channel >
-handle< R > async( boost::detail::thread_move_t< task< R > > t, static_pool< Channel > & pool)
-{ return pool.submit( t); }
-
-template< typename R, typename Channel, typename Attr >
-handle< R > async( boost::detail::thread_move_t< task< R > > t, Attr attr, static_pool< Channel > & pool)
-{ return pool.submit( t, attr); }
-# endif
+handle< R > async( task< R > t, Attr attr, static_pool< Channel > & pool)
+{ return pool.submit( boost::move( t), attr); }
 } }
 
 #include <boost/config/abi_suffix.hpp>

Modified: sandbox/task/boost/task/bounded_channel.hpp
==============================================================================
--- sandbox/task/boost/task/bounded_channel.hpp (original)
+++ sandbox/task/boost/task/bounded_channel.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -18,7 +18,7 @@
 #include <boost/thread/locks.hpp>
 #include <boost/thread/shared_mutex.hpp>
 
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/exceptions.hpp>
 #include <boost/task/watermark.hpp>
 
@@ -92,12 +92,12 @@
                 BOOST_ASSERT( deactive_now_() );
         }
 
- const std::vector< detail::pool_callable > drain_()
+ const std::vector< detail::callable > drain_()
         {
                 BOOST_ASSERT( deactive_now_() );
- std::vector< detail::pool_callable > unprocessed;
+ std::vector< detail::callable > unprocessed;
                 unprocessed.reserve( queue_.size() );
- BOOST_FOREACH( detail::pool_callable ca, queue_)
+ BOOST_FOREACH( detail::callable ca, queue_)
                 { unprocessed.push_back( ca); }
                 clear_();
                 BOOST_ASSERT( empty_() );
@@ -166,7 +166,7 @@
         }
 
         bool take_(
- detail::pool_callable & ca,
+ detail::callable & ca,
                 unique_lock< shared_mutex > & lk)
         {
                 if ( deactive_now_() || ( deactive_() && empty_() ) )
@@ -198,7 +198,7 @@
 
         template< typename Duration >
         bool take_(
- detail::pool_callable & ca,
+ detail::callable & ca,
                 Duration const& rel_time,
                 unique_lock< shared_mutex > & lk)
         {
@@ -231,7 +231,7 @@
                 return ! ca.empty();
         }
 
- bool try_take_( detail::pool_callable & ca)
+ bool try_take_( detail::callable & ca)
         {
                 if ( deactive_now_() || empty_() )
                         return false;
@@ -304,7 +304,7 @@
                 deactivate_now_();
         }
 
- const std::vector< detail::pool_callable > drain()
+ const std::vector< detail::callable > drain()
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return drain_();
@@ -367,7 +367,7 @@
                 put_( itm, rel_time, lk);
         }
 
- bool take( detail::pool_callable & ca)
+ bool take( detail::callable & ca)
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return take_( ca, lk);
@@ -375,14 +375,14 @@
 
         template< typename Duration >
         bool take(
- detail::pool_callable & ca,
+ detail::callable & ca,
                 Duration const& rel_time)
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return take_( ca, rel_time, lk);
         }
 
- bool try_take( detail::pool_callable & ca)
+ bool try_take( detail::callable & ca)
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return try_take_( ca);

Added: sandbox/task/boost/task/detail/callable.hpp
==============================================================================
--- (empty file)
+++ sandbox/task/boost/task/detail/callable.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,105 @@
+
+// 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_DETAIL_CALLABLE_H
+#define BOOST_TASK_DETAIL_CALLABLE_H
+
+#include <boost/config.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
+#include <boost/utility.hpp>
+
+#include <boost/task/detail/config.hpp>
+#include <boost/task/detail/interrupter.hpp>
+#include <boost/task/task.hpp>
+
+#include <boost/config/abi_prefix.hpp>
+
+# if defined(BOOST_MSVC)
+# pragma warning(push)
+# pragma warning(disable:4251 4275)
+# endif
+
+namespace boost { namespace task
+{
+namespace detail
+{
+class BOOST_TASK_DECL callable
+{
+private:
+ friend class scoped_guard;
+
+ struct impl
+ {
+ virtual ~impl() {}
+ virtual void run() = 0;
+ virtual void set( shared_ptr< thread > &) = 0;
+ virtual void reset() = 0;
+ };
+
+ template< typename R >
+ class impl_wrapper : public impl
+ {
+ private:
+ task< R > t_;
+ detail::interrupter i_;
+
+ public:
+ impl_wrapper(
+ task< R > t,
+ detail::interrupter const& i)
+ : t_( boost::move( t) ), i_( i)
+ {}
+
+ void run()
+ { t_(); }
+
+ void set( shared_ptr< thread > & thrd)
+ { i_.set( thrd); }
+
+ void reset()
+ { i_.reset(); }
+ };
+
+ shared_ptr< impl > impl_;
+
+public:
+ class scoped_guard : public noncopyable
+ {
+ private:
+ callable & ca_;
+
+ public:
+ scoped_guard( callable &, shared_ptr< thread > &);
+
+ ~scoped_guard();
+ };
+
+ callable();
+
+ template< typename R >
+ callable(
+ task< R > t,
+ detail::interrupter const& i)
+ : impl_( new impl_wrapper< R >( boost::move( t), i) )
+ {}
+
+ void operator()();
+
+ bool empty() const;
+
+ void clear();
+};
+}}}
+
+# if defined(BOOST_MSVC)
+# pragma warning(pop)
+# endif
+
+#include <boost/config/abi_suffix.hpp>
+
+#endif // BOOST_TASK_DETAIL_CALLABLE_H
+

Modified: sandbox/task/boost/task/detail/interrupter.hpp
==============================================================================
--- sandbox/task/boost/task/detail/interrupter.hpp (original)
+++ sandbox/task/boost/task/detail/interrupter.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -38,13 +38,15 @@
                 mutex mtx_;
                 shared_ptr< thread > thrd_;
 
+ void set_( shared_ptr< thread > const& thrd);
+
+ void reset_();
+
                 void interrupt_();
 
         public:
                 impl();
 
- ~impl();
-
                 void set( shared_ptr< thread > const& thrd);
 
                 void reset();

Deleted: sandbox/task/boost/task/detail/pool_callable.hpp
==============================================================================
--- sandbox/task/boost/task/detail/pool_callable.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
+++ (empty file)
@@ -1,122 +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_DETAIL_POOL_CALLABLE_H
-#define BOOST_TASK_DETAIL_POOL_CALLABLE_H
-
-#include <boost/config.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/thread.hpp>
-#include <boost/utility.hpp>
-
-#include <boost/task/detail/config.hpp>
-#include <boost/task/detail/interrupter.hpp>
-#include <boost/task/task.hpp>
-
-#include <boost/config/abi_prefix.hpp>
-
-# if defined(BOOST_MSVC)
-# pragma warning(push)
-# pragma warning(disable:4251 4275)
-# endif
-
-namespace boost { namespace task
-{
-namespace detail
-{
-class BOOST_TASK_DECL pool_callable
-{
-private:
- friend class scoped_guard;
-
- struct impl
- {
- virtual ~impl() {}
- virtual void run() = 0;
- virtual void set( shared_ptr< thread > &) = 0;
- virtual void reset() = 0;
- };
-
- template< typename R >
- class impl_wrapper : public impl
- {
- private:
- task< R > t_;
- detail::interrupter i_;
-
- public:
-# if defined(BOOST_HAS_RVALUE_REFS)
- impl_wrapper(
- task< R > && t,
- detail::interrupter const& i)
- : t_( t), i_( i)
- {}
-# else
- impl_wrapper(
- boost::detail::thread_move_t< task< R > > t,
- detail::interrupter const& i)
- : t_( t), i_( i)
- {}
-# endif
-
- void run()
- { t_(); }
-
- void set( shared_ptr< thread > & thrd)
- { i_.set( thrd); }
-
- void reset()
- { i_.reset(); }
- };
-
- shared_ptr< impl > impl_;
-
-public:
- class scoped_guard : public noncopyable
- {
- private:
- pool_callable & ca_;
-
- public:
- scoped_guard( pool_callable &, shared_ptr< thread > &);
-
- ~scoped_guard();
- };
-
- pool_callable();
-
-# if defined(BOOST_HAS_RVALUE_REFS)
- template< typename R >
- pool_callable(
- task< R > && t,
- detail::interrupter const& i)
- : impl_( new impl_wrapper< R >( t, i) )
- {}
-# else
- template< typename R >
- pool_callable(
- boost::detail::thread_move_t< task< R > > t,
- detail::interrupter const& i)
- : impl_( new impl_wrapper< R >( t, i) )
- {}
-# endif
-
- void operator()();
-
- bool empty() const;
-
- void clear();
-};
-}}}
-
-# if defined(BOOST_MSVC)
-# pragma warning(pop)
-# endif
-
-#include <boost/config/abi_suffix.hpp>
-
-#endif // BOOST_TASK_DETAIL_POOL_CALLABLE_H
-

Deleted: sandbox/task/boost/task/detail/thread_callable.hpp
==============================================================================
--- sandbox/task/boost/task/detail/thread_callable.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
+++ (empty file)
@@ -1,99 +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_DETAIL_THREAD_CALLABLE_H
-#define BOOST_TASK_DETAIL_THREAD_CALLABLE_H
-
-#include <boost/config.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/thread.hpp>
-#include <boost/utility.hpp>
-
-#include <boost/task/detail/config.hpp>
-#include <boost/task/detail/interrupter.hpp>
-#include <boost/task/semaphore.hpp>
-#include <boost/task/task.hpp>
-
-#include <boost/config/abi_prefix.hpp>
-
-# if defined(BOOST_MSVC)
-# pragma warning(push)
-# pragma warning(disable:4251 4275)
-# endif
-
-namespace boost { namespace task
-{
-namespace detail
-{
-class BOOST_TASK_DECL thread_callable
-{
-private:
- struct impl
- {
- virtual ~impl() {}
- virtual void run() = 0;
- };
-
- template< typename R >
- class impl_wrapper : public impl
- {
- private:
- task< R > t_;
- interrupter i_;
-
- public:
-# if defined(BOOST_HAS_RVALUE_REFS)
- impl_wrapper(
- task< R > && t,
- interrupter const& i)
- : t_( t), i_( i)
- {}
-# else
- impl_wrapper(
- boost::detail::thread_move_t< task< R > > t,
- interrupter const& i)
- : t_( t), i_( i)
- {}
-# endif
-
- ~impl_wrapper()
- { i_.reset(); }
-
- void run()
- { t_(); }
- };
-
- shared_ptr< impl > impl_;
-
-public:
-# if defined(BOOST_HAS_RVALUE_REFS)
- template< typename R >
- thread_callable(
- task< R > && t,
- interrupter const& i)
- : impl_( new impl_wrapper< R >( t, i) )
- {}
-# else
- template< typename R >
- thread_callable(
- boost::detail::thread_move_t< task< R > > t,
- interrupter const& i)
- : impl_( new impl_wrapper< R >( t, i) )
- {}
-# endif
-
- void operator()();
-};
-} } }
-
-# if defined(BOOST_MSVC)
-# pragma warning(pop)
-# endif
-
-#include <boost/config/abi_suffix.hpp>
-
-#endif // BOOST_TASK_DETAIL_THREAD_CALLABLE_H
-

Modified: sandbox/task/boost/task/detail/worker.hpp
==============================================================================
--- sandbox/task/boost/task/detail/worker.hpp (original)
+++ sandbox/task/boost/task/detail/worker.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -18,7 +18,7 @@
 #include <boost/utility.hpp>
 
 #include <boost/task/detail/config.hpp>
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/detail/guard.hpp>
 #include <boost/task/detail/interrupter.hpp>
 #include <boost/task/detail/wsq.hpp>
@@ -52,11 +52,11 @@
 
                 virtual void interrupt() const = 0;
 
- virtual void put( pool_callable const&) = 0;
+ virtual void put( callable const&) = 0;
 
- virtual bool try_take( pool_callable &) = 0;
+ virtual bool try_take( callable &) = 0;
 
- virtual bool try_steal( pool_callable &) = 0;
+ virtual bool try_steal( callable &) = 0;
 
                 virtual void signal_shutdown() = 0;
 
@@ -102,19 +102,19 @@
                 std::size_t scns_;
                 random_idx rnd_idx_;
 
- void execute_( pool_callable & ca)
+ void execute_( callable & ca)
                 {
                         BOOST_ASSERT( ! ca.empty() );
                         guard grd( get_pool().active_worker_);
                         {
- pool_callable::scoped_guard lk( ca, thrd_);
+ callable::scoped_guard lk( ca, thrd_);
                                 ca();
                         }
                         ca.clear();
                         BOOST_ASSERT( ca.empty() );
                 }
         
- void next_pool_callable_( pool_callable & ca)
+ void next_callable_( callable & ca)
                 {
                         if ( ! try_take( ca) )
                         {
@@ -149,7 +149,7 @@
                         }
                 }
         
- void next_local_pool_callable_( pool_callable & ca)
+ void next_local_callable_( callable & ca)
                 {
                         if ( ! try_take( ca) )
                         {
@@ -221,24 +221,24 @@
                 void signal_shutdown_now()
                 { shtdwn_now_sem_.post(); }
 
- void put( pool_callable const& ca)
+ void put( callable const& ca)
                 {
                         BOOST_ASSERT( ! ca.empty() );
                         wsq_.put( ca);
                 }
 
- bool try_take( pool_callable & ca)
+ bool try_take( callable & ca)
                 {
- pool_callable tmp;
+ callable tmp;
                         bool result( wsq_.try_take( tmp) );
                         if ( result)
                                 ca = tmp;
                         return result;
                 }
                 
- bool try_steal( pool_callable & ca)
+ bool try_steal( callable & ca)
                 {
- pool_callable tmp;
+ callable tmp;
                         bool result( wsq_.try_steal( tmp) );
                         if ( result)
                                 ca = tmp;
@@ -252,10 +252,10 @@
                 {
                         BOOST_ASSERT( get_id() == this_thread::get_id() );
 
- pool_callable ca;
+ callable ca;
                         while ( ! shutdown_() )
                         {
- next_pool_callable_( ca);
+ next_callable_( ca);
                                 if( ! ca.empty() )
                                 {
                                         execute_( ca);
@@ -266,10 +266,10 @@
 
                 void reschedule_until( function< bool() > const& pred)
                 {
- pool_callable ca;
+ callable ca;
                         while ( ! pred() )
                         {
- next_local_pool_callable_( ca);
+ next_local_callable_( ca);
                                 if( ! ca.empty() )
                                 {
                                         execute_( ca);
@@ -306,9 +306,9 @@
         void signal_shutdown();
         void signal_shutdown_now();
 
- void put( pool_callable const&);
- bool try_take( pool_callable &);
- bool try_steal( pool_callable &);
+ void put( callable const&);
+ bool try_take( callable &);
+ bool try_steal( callable &);
 
         void reschedule_until( function< bool() > const&);
 

Modified: sandbox/task/boost/task/detail/worker_group.hpp
==============================================================================
--- sandbox/task/boost/task/detail/worker_group.hpp (original)
+++ sandbox/task/boost/task/detail/worker_group.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -63,26 +63,30 @@
 
         worker_group();
 
+ ~worker_group();
+
         const worker operator[]( std::size_t pos) const;
 
         std::size_t size() const;
 
- const iterator begin();
+ bool empty() const;
 
+ const iterator begin();
         const const_iterator begin() const;
 
         const iterator end();
-
         const const_iterator end() const;
 
         const const_iterator find( thread::id const& id) const;
 
+ void insert( worker const& w);
+
+ iterator erase( iterator const& i);
+
         void join_all();
 
         void interrupt_all();
 
- void insert( worker const& w);
-
         void signal_shutdown_all();
 
         void signal_shutdown_now_all();

Modified: sandbox/task/boost/task/detail/wsq.hpp
==============================================================================
--- sandbox/task/boost/task/detail/wsq.hpp (original)
+++ sandbox/task/boost/task/detail/wsq.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -13,7 +13,7 @@
 #include <boost/utility.hpp>
 
 #include <boost/task/detail/config.hpp>
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -30,7 +30,7 @@
 {
 private:
         const int initial_size_;
- shared_array< pool_callable > array_;
+ shared_array< callable > array_;
         int capacity_;
         int mask_;
         volatile uint32_t head_idx_;
@@ -44,11 +44,11 @@
 
         std::size_t size() const;
 
- void put( pool_callable const&);
+ void put( callable const&);
 
- bool try_take( pool_callable &);
+ bool try_take( callable &);
 
- bool try_steal( pool_callable &);
+ bool try_steal( callable &);
 };
 }}}
 

Modified: sandbox/task/boost/task/fifo.hpp
==============================================================================
--- sandbox/task/boost/task/fifo.hpp (original)
+++ sandbox/task/boost/task/fifo.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -10,7 +10,7 @@
 #include <cstddef>
 #include <list>
 
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/detail/meta.hpp>
 
 #include <boost/config/abi_prefix.hpp>
@@ -24,7 +24,7 @@
         class impl
         {
         public:
- typedef detail::pool_callable item;
+ typedef detail::callable item;
                 typedef std::list< item >::iterator iterator;
                 typedef std::list< item >::const_iterator const_iterator;
         

Modified: sandbox/task/boost/task/new_thread.hpp
==============================================================================
--- sandbox/task/boost/task/new_thread.hpp (original)
+++ sandbox/task/boost/task/new_thread.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -13,6 +13,7 @@
 #include <boost/thread/detail/move.hpp>
 
 #include <boost/task/detail/interrupter.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/future.hpp>
 #include <boost/task/handle.hpp>
 #include <boost/task/task.hpp>
@@ -40,19 +41,15 @@
 struct new_thread
 {
         template< typename R >
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > operator()( task< R > && t_)
-# else
- handle< R > operator()( boost::detail::thread_move_t< task< R > > t_)
-# endif
+ handle< R > operator()( task< R > t)
         {
- task< R > t( t_);
                 shared_future< R > fut( t.get_future() );
 
+ detail::interrupter intr;
                 shared_ptr< thread > thrd(
- new thread( boost::move( t) ),
+ new thread(
+ detail::callable( boost::move( t), intr) ),
                                 detail::joiner() );
- detail::interrupter intr;
                 intr.set( thrd);
 
                 return handle< R >( fut, intr);

Modified: sandbox/task/boost/task/own_thread.hpp
==============================================================================
--- sandbox/task/boost/task/own_thread.hpp (original)
+++ sandbox/task/boost/task/own_thread.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -21,13 +21,8 @@
 struct own_thread
 {
         template< typename R >
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > operator()( task< R > && t_)
-# else
- handle< R > operator()( boost::detail::thread_move_t< task< R > > t_)
-# endif
+ handle< R > operator()( task< R > t)
         {
- task< R > t( t_);
                 shared_future< R > fut( t.get_future() );
                 detail::interrupter intr;
                 intr.reset();

Modified: sandbox/task/boost/task/priority.hpp
==============================================================================
--- sandbox/task/boost/task/priority.hpp (original)
+++ sandbox/task/boost/task/priority.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -15,7 +15,7 @@
 #include <boost/multi_index/mem_fun.hpp>
 #include <boost/multi_index/ordered_index.hpp>
 
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/detail/meta.hpp>
 
 #include <boost/config/abi_prefix.hpp>
@@ -41,17 +41,17 @@
                 class item
                 {
                 private:
- detail::pool_callable ca_;
+ detail::callable ca_;
                         attribute attr_;
         
                 public:
                         item(
- detail::pool_callable const& ca,
+ detail::callable const& ca,
                                 attribute const& attr)
                         : ca_( ca), attr_( attr)
                         { BOOST_ASSERT( ! ca_.empty() ); }
         
- const detail::pool_callable ca() const
+ const detail::callable ca() const
                         { return ca_; }
         
                         const attribute attr() const
@@ -90,7 +90,7 @@
                 void push( item const& itm)
                 { idx_.insert( itm); }
         
- const detail::pool_callable pop()
+ const detail::callable pop()
                 {
                         iterator i( lst_.begin() );
                         BOOST_ASSERT( i != lst_.end() );

Modified: sandbox/task/boost/task/smart.hpp
==============================================================================
--- sandbox/task/boost/task/smart.hpp (original)
+++ sandbox/task/boost/task/smart.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -14,7 +14,7 @@
 #include <boost/multi_index/mem_fun.hpp>
 #include <boost/multi_index/ordered_index.hpp>
 
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/detail/meta.hpp>
 
 #include <boost/config/abi_prefix.hpp>
@@ -44,7 +44,7 @@
                 class item
                 {
                 private:
- detail::pool_callable ca_;
+ detail::callable ca_;
                         attribute attr_;
         
                 public:
@@ -53,12 +53,12 @@
                         {}
 
                         item(
- detail::pool_callable const& ca,
+ detail::callable const& ca,
                                 attribute const& attr)
                         : ca_( ca), attr_( attr)
                         { BOOST_ASSERT( ! ca_.empty() ); }
         
- const detail::pool_callable ca() const
+ const detail::callable ca() const
                         { return ca_; }
         
                         const attribute attr() const
@@ -103,7 +103,7 @@
                 void push( item const& itm)
                 { enq_op_( idx_, itm); }
         
- const detail::pool_callable pop()
+ const detail::callable pop()
                 {
                         item itm;
                         deq_op_( idx_, itm);

Modified: sandbox/task/boost/task/static_pool.hpp
==============================================================================
--- sandbox/task/boost/task/static_pool.hpp (original)
+++ sandbox/task/boost/task/static_pool.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -19,12 +19,11 @@
 #include <boost/function.hpp>
 #include <boost/thread.hpp>
 #include <boost/thread/detail/move.hpp>
-#include <boost/utility.hpp>
 
 #include <boost/task/detail/atomic.hpp>
 #include <boost/task/detail/bind_processor.hpp>
 #include <boost/task/detail/interrupter.hpp>
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/detail/worker.hpp>
 #include <boost/task/detail/worker_group.hpp>
 #include <boost/task/exceptions.hpp>
@@ -40,7 +39,7 @@
 namespace boost { namespace task
 {
 template< typename Channel >
-class static_pool : private noncopyable
+class static_pool
 {
 public:
         typedef Channel channel;
@@ -278,7 +277,6 @@
                         shared_lock< shared_mutex > lk( mtx_wg_);
                         wg_.signal_shutdown_all();
                         wg_.join_all();
- lk.unlock();
                 }
 
                 const void shutdown_now()
@@ -290,7 +288,6 @@
                         wg_.signal_shutdown_now_all();
                         wg_.interrupt_all();
                         wg_.join_all();
- lk.unlock();
                 }
 
                 std::size_t size()
@@ -324,19 +321,14 @@
                 { channel_.lower_bound( lwm); }
 
                 template< typename R >
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > submit( task< R > && t_)
-#else
- handle< R > submit( boost::detail::thread_move_t< task< R > > t_)
-# endif
+ handle< R > submit( task< R > t)
                 {
                         if ( closed_() )
                                 throw task_rejected("pool is closed");
 
- task< R > t( t_);
                         shared_future< R > fut( t.get_future() );
                         detail::interrupter intr;
- channel_.put( detail::pool_callable( boost::move( t), intr) );
+ channel_.put( detail::callable( boost::move( t), intr) );
                         return handle< R >( fut, intr);
                 }
 
@@ -344,26 +336,23 @@
                         typename R,
                         typename Attr
>
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > submit( task< R > && t_, Attr const& attr)
-#else
-
- handle< R > submit( boost::detail::thread_move_t< task< R > > t_, Attr const& attr)
-# endif
+ handle< R > submit( task< R > t, Attr const& attr)
                 {
                         if ( closed_() )
                                 throw task_rejected("pool is closed");
 
- task< R > t( t_);
                         shared_future< R > fut( t.get_future() );
                         detail::interrupter intr;
- channel_.put( channel_item( detail::pool_callable( boost::move( t), intr), attr) );
+ channel_.put( channel_item( detail::callable( boost::move( t), intr), attr) );
                         return handle< R >( fut, intr);
                 }
         };
         
         shared_ptr< pool_base > pool_;
 
+ static_pool( static_pool &);
+ static_pool & operator=( static_pool &);
+
 public:
         static_pool()
         : pool_()
@@ -433,7 +422,13 @@
         }
 
         operator boost::detail::thread_move_t< static_pool >()
- { return boost::detail::thread_move_t< static_pool >( * this); }
+ { return move(); }
+
+ boost::detail::thread_move_t< static_pool > move()
+ {
+ boost::detail::thread_move_t< static_pool > t( * this);
+ return t;
+ }
 # endif
 
         std::size_t active()
@@ -535,31 +530,22 @@
         }
 
         template< typename R >
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > submit( task< R > && t)
-#else
- handle< R > submit( boost::detail::thread_move_t< task< R > > t)
-# endif
+ handle< R > submit( task< R > t)
         {
                 if ( ! pool_)
                         throw pool_moved();
- return pool_->submit( t);
+ return pool_->submit( boost::move( t) );
         }
 
         template<
                 typename R,
                 typename Attr
>
-# if defined(BOOST_HAS_RVALUE_REFS)
- handle< R > submit( task< R > && t, Attr const& attr)
-#else
-
- handle< R > submit( boost::detail::thread_move_t< task< R > > t, Attr const& attr)
-# endif
+ handle< R > submit( task< R > t, Attr const& attr)
         {
                 if ( ! pool_)
                         throw pool_moved();
- return pool_->submit( t, attr);
+ return pool_->submit( boost::move( t), attr);
         }
 
         typedef typename shared_ptr< pool_base >::unspecified_bool_type unspecified_bool_type;
@@ -585,8 +571,8 @@
 { return t; }
 # else
 template< typename Channel >
-boost::detail::thread_move_t< task::static_pool< Channel > > move( task::static_pool< Channel > & t)
-{ return t; }
+task::static_pool< Channel > move( boost::detail::thread_move_t< task::static_pool< Channel > > t)
+{ return task::static_pool< Channel >( t); }
 # endif
 }
 

Modified: sandbox/task/boost/task/task.hpp
==============================================================================
--- sandbox/task/boost/task/task.hpp (original)
+++ sandbox/task/boost/task/task.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -174,7 +174,7 @@
 }
 
 template< typename R >
-class task : private noncopyable
+class task
 {
 private:
         template< typename Channel >
@@ -186,6 +186,9 @@
 
         shared_ptr< detail::task_base< R > > task_;
 
+ task( task &);
+ task & operator=( task &);
+
 public:
         task()
         : task_()
@@ -227,7 +230,7 @@
         {}
 #endif
         template< typename Fn >
- task( boost::detail::thread_move_t< Fn > fn)
+ explicit task( boost::detail::thread_move_t< Fn > fn)
         : task_( new detail::task_wrapper< R, Fn >( fn) )
         {}
 
@@ -242,11 +245,14 @@
             return * this;
         }
 
- boost::detail::thread_move_t< task > move()
- { return boost::detail::thread_move_t< task >( * this); }
-
         operator boost::detail::thread_move_t< task >()
- { return boost::detail::thread_move_t< task >( * this); }
+ { return move(); }
+
+ boost::detail::thread_move_t< task > move()
+ {
+ boost::detail::thread_move_t< task > t( * this);
+ return t;
+ }
 # endif
 
 # ifndef BOOST_TASK_MAKE_TASK_MAX_ARITY
@@ -320,8 +326,8 @@
 { return t; }
 # else
 template< typename R >
-boost::detail::thread_move_t< task::task< R > > move( task::task< R > & t)
-{ return t; }
+task::task< R > move( boost::detail::thread_move_t< task::task< R > > t)
+{ return task::task< R >( t); }
 # endif
 }
 

Modified: sandbox/task/boost/task/unbounded_channel.hpp
==============================================================================
--- sandbox/task/boost/task/unbounded_channel.hpp (original)
+++ sandbox/task/boost/task/unbounded_channel.hpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -18,7 +18,7 @@
 #include <boost/thread/locks.hpp>
 #include <boost/thread/shared_mutex.hpp>
 
-#include <boost/task/detail/pool_callable.hpp>
+#include <boost/task/detail/callable.hpp>
 #include <boost/task/exceptions.hpp>
 
 #include <boost/config/abi_prefix.hpp>
@@ -88,12 +88,12 @@
                 BOOST_ASSERT( deactive_now_() );
         }
 
- const std::vector< detail::pool_callable > drain_()
+ const std::vector< detail::callable > drain_()
         {
                 BOOST_ASSERT( deactive_now_() );
- std::vector< detail::pool_callable > unprocessed;
+ std::vector< detail::callable > unprocessed;
                 unprocessed.reserve( queue_.size() );
- BOOST_FOREACH( detail::pool_callable ca, queue_)
+ BOOST_FOREACH( detail::callable ca, queue_)
                 { unprocessed.push_back( ca); }
                 clear_();
                 BOOST_ASSERT( empty_() );
@@ -117,7 +117,7 @@
         }
 
         bool take_(
- detail::pool_callable & ca,
+ detail::callable & ca,
                 unique_lock< shared_mutex > & lk)
         {
                 if ( deactive_now_() || ( deactive_() && empty_() ) )
@@ -140,7 +140,7 @@
 
         template< typename Duration >
         bool take_(
- detail::pool_callable & ca,
+ detail::callable & ca,
                 Duration const& rel_time,
                 unique_lock< shared_mutex > & lk)
         {
@@ -164,7 +164,7 @@
                 return ! ca.empty();
         }
 
- bool try_take_( detail::pool_callable & ca)
+ bool try_take_( detail::callable & ca)
         {
                 if ( deactive_now_() || empty_() )
                         return false;
@@ -217,7 +217,7 @@
                 deactivate_now_();
         }
 
- const std::vector< detail::pool_callable > drain()
+ const std::vector< detail::callable > drain()
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return drain_();
@@ -253,7 +253,7 @@
                 put_( itm, lk);
         }
 
- bool take( detail::pool_callable & ca)
+ bool take( detail::callable & ca)
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return take_( ca, lk);
@@ -261,14 +261,14 @@
 
         template< typename Duration >
         bool take(
- detail::pool_callable & ca,
+ detail::callable & ca,
                 Duration const& rel_time)
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return take_( ca, rel_time, lk);
         }
 
- bool try_take( detail::pool_callable & ca)
+ bool try_take( detail::callable & ca)
         {
                 unique_lock< shared_mutex > lk( mtx_);
                 return try_take_( ca);

Modified: sandbox/task/change.log
==============================================================================
--- sandbox/task/change.log (original)
+++ sandbox/task/change.log 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -1,3 +1,12 @@
+* boost.task-0.2.2:
+-------------------
+- private inheritance from noncopyable removed from task< R > and static_pool< R >
+ copy-ctor and assignment-op private and unimplemented
+ allowing correct move-semantics
+- worker_group removes all worker-threads in join_all()
+ static_pool< R > does contain zero worker-threads after shutdown() or shutdown_now()
+
+
 * boost.task-0.2.1:
 -------------------
 - bugfix related to FreeBSD

Modified: sandbox/task/libs/task/build/Jamfile.v2
==============================================================================
--- sandbox/task/libs/task/build/Jamfile.v2 (original)
+++ sandbox/task/libs/task/build/Jamfile.v2 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -37,7 +37,7 @@
     : ## win32 sources ##
         guard.cpp
         interrupter.cpp
- pool_callable.cpp
+ callable.cpp
         poolsize.cpp
         scanns.cpp
         semaphore_windows.cpp
@@ -53,7 +53,7 @@
     : ## posix sources ##
         guard.cpp
         interrupter.cpp
- pool_callable.cpp
+ callable.cpp
         poolsize.cpp
         scanns.cpp
         semaphore_posix.cpp

Added: sandbox/task/libs/task/src/callable.cpp
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/src/callable.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -0,0 +1,36 @@
+
+// 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)
+
+#include "boost/task/detail/callable.hpp"
+
+namespace boost { namespace task
+{
+namespace detail
+{
+callable::callable()
+: impl_()
+{}
+
+void
+callable::operator()()
+{ impl_->run(); }
+
+bool
+callable::empty() const
+{ return ! impl_; }
+
+void
+callable::clear()
+{ impl_.reset(); }
+
+callable::scoped_guard::scoped_guard( callable & ca, shared_ptr< thread > & thrd)
+: ca_( ca)
+{ ca_.impl_->set( thrd); }
+
+callable::scoped_guard::~scoped_guard()
+{ ca_.impl_->reset(); }
+} } }
+

Modified: sandbox/task/libs/task/src/interrupter.cpp
==============================================================================
--- sandbox/task/libs/task/src/interrupter.cpp (original)
+++ sandbox/task/libs/task/src/interrupter.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -13,6 +13,26 @@
 namespace detail
 {
 void
+interrupter::impl::set_( shared_ptr< thread > const& thrd)
+{
+ thrd_ = thrd;
+ BOOST_ASSERT( thrd_);
+ if ( interruption_requested_)
+ if ( thrd_) thrd_->interrupt();
+}
+
+void
+interrupter::impl::reset_()
+{
+ try
+ { this_thread::interruption_point(); }
+ catch ( thread_interrupted const&)
+ {}
+ thrd_.reset();
+ BOOST_ASSERT( ! this_thread::interruption_requested() );
+}
+
+void
 interrupter::impl::interrupt_()
 {
         if ( ! interruption_requested_)
@@ -29,29 +49,18 @@
 thrd_()
 {}
 
-interrupter::impl::~impl()
-{ reset(); }
-
 void
 interrupter::impl::set( shared_ptr< thread > const& thrd)
 {
         unique_lock< mutex > lk( mtx_);
- thrd_ = thrd;
- BOOST_ASSERT( thrd_);
- if ( interruption_requested_)
- if ( thrd_) thrd_->interrupt();
+ set_( thrd);
 }
 
 void
 interrupter::impl::reset()
 {
         unique_lock< mutex > lk( mtx_);
- try
- { this_thread::interruption_point(); }
- catch ( thread_interrupted const&)
- {}
- thrd_.reset();
- BOOST_ASSERT( ! this_thread::interruption_requested() );
+ reset_();
 }
 
 void

Deleted: sandbox/task/libs/task/src/pool_callable.cpp
==============================================================================
--- sandbox/task/libs/task/src/pool_callable.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
+++ (empty file)
@@ -1,36 +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)
-
-#include "boost/task/detail/pool_callable.hpp"
-
-namespace boost { namespace task
-{
-namespace detail
-{
-pool_callable::pool_callable()
-: impl_()
-{}
-
-void
-pool_callable::operator()()
-{ impl_->run(); }
-
-bool
-pool_callable::empty() const
-{ return ! impl_; }
-
-void
-pool_callable::clear()
-{ impl_.reset(); }
-
-pool_callable::scoped_guard::scoped_guard( pool_callable & ca, shared_ptr< thread > & thrd)
-: ca_( ca)
-{ ca_.impl_->set( thrd); }
-
-pool_callable::scoped_guard::~scoped_guard()
-{ ca_.impl_->reset(); }
-} } }
-

Deleted: sandbox/task/libs/task/src/thread_callable.cpp
==============================================================================
--- sandbox/task/libs/task/src/thread_callable.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
+++ (empty file)
@@ -1,20 +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)
-
-#include "boost/task/detail/thread_callable.hpp"
-
-namespace boost { namespace task
-{
-namespace detail
-{
-void
-thread_callable::operator()()
-{
- impl_->run();
- impl_.reset();
-}
-} } }
-

Modified: sandbox/task/libs/task/src/worker.cpp
==============================================================================
--- sandbox/task/libs/task/src/worker.cpp (original)
+++ sandbox/task/libs/task/src/worker.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -33,15 +33,15 @@
 { impl_->signal_shutdown_now(); }
 
 void
-worker::put( pool_callable const& ca)
+worker::put( callable const& ca)
 { impl_->put( ca); }
 
 bool
-worker::try_take( pool_callable & ca)
+worker::try_take( callable & ca)
 { return impl_->try_take( ca); }
 
 bool
-worker::try_steal( pool_callable & ca)
+worker::try_steal( callable & ca)
 { return impl_->try_steal( ca); }
 
 void

Modified: sandbox/task/libs/task/src/worker_group.cpp
==============================================================================
--- sandbox/task/libs/task/src/worker_group.cpp (original)
+++ sandbox/task/libs/task/src/worker_group.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -20,6 +20,12 @@
 rnd_idx_( cont_.get< rnd_idx_tag >() )
 {}
 
+worker_group::~worker_group()
+{
+ if ( ! empty() )
+ join_all();
+}
+
 const worker
 worker_group::operator[]( std::size_t pos) const
 { return rnd_idx_[pos]; }
@@ -28,6 +34,10 @@
 worker_group::size() const
 { return cont_.size(); }
 
+bool
+worker_group::empty() const
+{ return cont_.empty(); }
+
 const worker_group::iterator
 worker_group::begin()
 { return id_idx_.begin(); }
@@ -49,6 +59,14 @@
 { return id_idx_.find( id); }
 
 void
+worker_group::insert( worker const& w)
+{ cont_.insert( w); }
+
+worker_group::iterator
+worker_group::erase( iterator const& i)
+{ return id_idx_.erase( i); }
+
+void
 worker_group::join_all()
 {
         BOOST_FOREACH( worker w, cont_)
@@ -58,6 +76,7 @@
                 catch (...)
                 {}
         }
+ cont_.clear();
 }
 
 void
@@ -68,10 +87,6 @@
 }
 
 void
-worker_group::insert( worker const& w)
-{ cont_.insert( w); }
-
-void
 worker_group::signal_shutdown_all()
 {
         BOOST_FOREACH( worker w, cont_)

Modified: sandbox/task/libs/task/src/wsq.cpp
==============================================================================
--- sandbox/task/libs/task/src/wsq.cpp (original)
+++ sandbox/task/libs/task/src/wsq.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -17,7 +17,7 @@
 wsq::wsq()
 :
 initial_size_( 32),
-array_( new pool_callable[ initial_size_]),
+array_( new callable[ initial_size_]),
 capacity_( initial_size_),
 mask_( initial_size_ - 1),
 head_idx_( 0),
@@ -34,7 +34,7 @@
 { return tail_idx_ - head_idx_; }
 
 void
-wsq::put( pool_callable const& ca)
+wsq::put( callable const& ca)
 {
         uint32_t tail( tail_idx_);
         if ( tail <= head_idx_ + mask_)
@@ -51,7 +51,7 @@
                 if ( count >= mask_)
                 {
                         capacity_ <<= 1;
- shared_array< pool_callable > array( new pool_callable[capacity_]);
+ shared_array< callable > array( new callable[capacity_]);
                         for ( int i( 0); i != count; ++i)
                                 array[i] = array_[(i + head) & mask_];
                         array_.swap( array);
@@ -65,7 +65,7 @@
 }
 
 bool
-wsq::try_take( pool_callable & ca)
+wsq::try_take( callable & ca)
 {
         uint32_t tail( tail_idx_);
         if ( tail == 0)
@@ -94,7 +94,7 @@
 }
 
 bool
-wsq::try_steal( pool_callable & ca)
+wsq::try_steal( callable & ca)
 {
         recursive_mutex::scoped_try_lock lk( mtx_);
         if ( lk.owns_lock() )

Modified: sandbox/task/libs/task/test/test_bounded_pool.cpp
==============================================================================
--- sandbox/task/libs/task/test/test_bounded_pool.cpp (original)
+++ sandbox/task/libs/task/test/test_bounded_pool.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -214,8 +214,8 @@
                 BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
                 pool.shutdown_now();
                 BOOST_CHECK( pool.closed() );
- BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
- BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 1) );
+ BOOST_CHECK_EQUAL( pool.size(), std::size_t( 0) );
+ BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 0) );
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 BOOST_CHECK_THROW( h.get(), tsk::task_interrupted);
         }

Modified: sandbox/task/libs/task/test/test_unbounded_pool.cpp
==============================================================================
--- sandbox/task/libs/task/test/test_unbounded_pool.cpp (original)
+++ sandbox/task/libs/task/test/test_unbounded_pool.cpp 2009-06-27 03:59:49 EDT (Sat, 27 Jun 2009)
@@ -179,8 +179,8 @@
                 BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
                 pool.shutdown_now();
                 BOOST_CHECK( pool.closed() );
- BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
- BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 1) );
+ BOOST_CHECK_EQUAL( pool.size(), std::size_t( 0) );
+ BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 0) );
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 BOOST_CHECK_THROW( h.get(), tsk::task_interrupted);
         }


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