|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51784 - in sandbox/threadpool: boost/tp boost/tp/detail libs/tp/doc libs/tp/src libs/tp/test
From: oliver.kowalke_at_[hidden]
Date: 2009-03-15 09:44:40
Author: olli
Date: 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
New Revision: 51784
URL: http://svn.boost.org/trac/boost/changeset/51784
Log:
* removed state-mutex and member-functions terminating() and terminated()
* pool has new member-function closed()
* poll state closed via atomic increment of member-variable status_
Text files modified:
sandbox/threadpool/boost/tp/detail/guard.hpp | 9 +--
sandbox/threadpool/boost/tp/lockfree_channel.hpp | 3 +
sandbox/threadpool/boost/tp/pool.hpp | 82 ++++++++++++++-------------------------
sandbox/threadpool/libs/tp/doc/pool.qbk | 4
sandbox/threadpool/libs/tp/doc/pool_ref.qbk | 30 ++++----------
sandbox/threadpool/libs/tp/src/guard.cpp | 10 +++-
sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_lockfree_queue.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp | 6 +-
sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp | 6 +-
15 files changed, 80 insertions(+), 112 deletions(-)
Modified: sandbox/threadpool/boost/tp/detail/guard.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/detail/guard.hpp (original)
+++ sandbox/threadpool/boost/tp/detail/guard.hpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -5,21 +5,18 @@
#ifndef BOOST_TP_DETAIL_GUARD_H
#define BOOST_TP_DETAIL_GUARD_H
-#include <boost/assert.hpp>
-#include <boost/interprocess/detail/atomic.hpp>
#include <boost/utility.hpp>
namespace boost { namespace tp {
namespace detail
{
-class guard
-: private noncopyable
+class guard : private noncopyable
{
private:
- volatile uint32_t & active_worker_;
+ unsigned int & active_worker_;
public:
- guard( volatile uint32_t & active_worker);
+ guard( unsigned int & active_worker);
~guard();
};
Modified: sandbox/threadpool/boost/tp/lockfree_channel.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/lockfree_channel.hpp (original)
+++ sandbox/threadpool/boost/tp/lockfree_channel.hpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -1,6 +1,9 @@
#ifndef BOOST_TP_LOCKFREE_CHANNEL_H
#define BOOST_TP_LOCKFREE_CHANNEL_H
+// based on the lock-free algorithm of
+// Edya Ladan-Mozes and Nir Shavit
+
#include <vector>
#include <boost/assert.hpp>
Modified: sandbox/threadpool/boost/tp/pool.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/pool.hpp (original)
+++ sandbox/threadpool/boost/tp/pool.hpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -28,6 +28,7 @@
#include <boost/utility.hpp>
#include <boost/utility/result_of.hpp>
+#include <boost/tp/detail/atomic.hpp>
#include <boost/tp/detail/callable.hpp>
#include <boost/tp/detail/guard.hpp>
#include <boost/tp/detail/interrupter.hpp>
@@ -143,14 +144,13 @@
worker_list worker_;
shared_mutex mtx_worker_;
- state state_;
- shared_mutex mtx_state_;
+ unsigned int state_;
channel channel_;
posix_time::time_duration asleep_;
scanns scns_;
- volatile uint32_t active_worker_;
- volatile uint32_t idle_worker_;
- volatile uint32_t running_worker_;
+ unsigned int active_worker_;
+ unsigned int idle_worker_;
+ unsigned int running_worker_;
void execute_(
detail::callable & ca,
@@ -313,6 +313,12 @@
return false;
}
+ bool closed_() const
+ { return state_ > 0; }
+
+ void close_()
+ { detail::atomic_fetch_add( & state_, 1); }
+
public:
explicit pool(
poolsize const& psize,
@@ -321,8 +327,7 @@
:
worker_(),
mtx_worker_(),
- state_( active_state),
- mtx_state_(),
+ state_( 0),
channel_(),
asleep_( asleep),
scns_( scns),
@@ -348,8 +353,7 @@
:
worker_(),
mtx_worker_(),
- state_( active_state),
- mtx_state_(),
+ state_( 0),
channel_(
hwm,
lwm),
@@ -375,8 +379,7 @@
:
worker_(),
mtx_worker_(),
- state_( active_state),
- mtx_state_(),
+ state_( 0),
channel_(),
asleep_( asleep),
scns_( scns),
@@ -403,8 +406,7 @@
:
worker_(),
mtx_worker_(),
- state_( active_state),
- mtx_state_(),
+ state_( 0),
channel_(
hwm,
lwm),
@@ -443,32 +445,25 @@
void shutdown()
{
- unique_lock< shared_mutex > lk1( mtx_state_);
- if ( terminateing_() || terminated_() ) return;
- state_ = terminateing_state;
- lk1.unlock();
+ if ( closed_() ) return;
+ close_();
channel_.deactivate();
- shared_lock< shared_mutex > lk2( mtx_worker_);
+ shared_lock< shared_mutex > lk( mtx_worker_);
BOOST_FOREACH( detail::worker w, worker_)
{ w.signal_shutdown(); }
BOOST_FOREACH( detail::worker w, worker_)
{ w.join(); }
- lk2.unlock();
-
- lk1.lock();
- state_ = terminated_state;
+ lk.unlock();
}
const std::vector< detail::callable > shutdown_now()
{
- unique_lock< shared_mutex > lk1( mtx_state_);
- if ( terminateing_() || terminated_() ) return std::vector< detail::callable >();
- state_ = terminateing_state;
- lk1.unlock();
+ if ( closed_() ) return std::vector< detail::callable >();
+ close_();
channel_.deactivate_now();
- shared_lock< shared_mutex > lk2( mtx_worker_);
+ shared_lock< shared_mutex > lk( mtx_worker_);
BOOST_FOREACH( detail::worker w, worker_)
{
w.signal_shutdown_now();
@@ -476,13 +471,9 @@
}
BOOST_FOREACH( detail::worker w, worker_)
{ w.join(); }
- lk2.unlock();
+ lk.unlock();
std::vector< detail::callable > drain( channel_.drain() );
- lk1.lock();
- state_ = terminated_state;
- lk1.unlock();
-
return drain;
}
@@ -492,17 +483,8 @@
return size_();
}
- bool terminated()
- {
- shared_lock< shared_mutex > lk( mtx_state_);
- return terminated_();
- }
-
- bool terminateing()
- {
- shared_lock< shared_mutex > lk( mtx_state_);
- return terminateing_();
- }
+ bool closed()
+ { return closed_(); }
void clear()
{ channel_.clear(); }
@@ -549,11 +531,8 @@
}
else
{
- shared_lock< shared_mutex > lk( mtx_state_);
- if ( terminated_() )
- throw task_rejected("pool ist terminated");
- if ( terminateing_() )
- throw task_rejected("pool ist terminateing");
+ if ( closed_() )
+ throw task_rejected("pool is closed");
channel_item itm( detail::callable( move( tsk) ), intr);
channel_.put( itm);
@@ -590,11 +569,8 @@
}
else
{
- shared_lock< shared_mutex > lk( mtx_state_);
- if ( terminated_() )
- throw task_rejected("pool ist terminated");
- if ( terminateing_() )
- throw task_rejected("pool ist terminateing");
+ if ( closed_() )
+ throw task_rejected("pool is closed");
channel_item itm( detail::callable( move( tsk) ), attr, intr);
channel_.put( itm);
Modified: sandbox/threadpool/libs/tp/doc/pool.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/pool.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/pool.qbk 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -57,7 +57,7 @@
[heading Shutdown]
-If `boost::tp::pool< Channel >::shutdown()` is called - the the status of the pool is set to ['terminating] and all __worker_threads__ are joined. No futher __actions__ can be submitted by application threads. After all pending __actions__ are processed and all __worker_threads__ are joined, the pool is set to status ['terminated].
+If `boost::tp::pool< Channel >::shutdown()` is called - the the pool is set closed and all __worker_threads__ are joined until all pending __actions__ are processed. No futher __actions__ can be submitted by application threads.
[note The deconstructor calls `boost::tp::pool< Channel >::shutdown()` if the pool was not shutdown yet.]
@@ -82,7 +82,7 @@
std::cout << t2.result().get() << std::endl; // 55
[heading Shutdown immediatly]
-The function `boost::tp::pool< Channel >::shutdown_now()` sets the pool status to ['terminating] interrupts and then joins all __worker_threads__. After the __worker_threads__ are joined the status of the pool is set to ['terminated] and all pending (unprocessed) __actions__ will be returned.
+The function `boost::tp::pool< Channel >::shutdown_now()` closes the pool, interrupts and then joins all __worker_threads__. All pending (unprocessed) __actions__ will be returned.
[important Pending __actions__ in the local __worker_queues__ are not returned if `boost::tp::pool< Channel >::shutdown_now()` was called.]
Modified: sandbox/threadpool/libs/tp/doc/pool_ref.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/pool_ref.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/pool_ref.qbk 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -46,8 +46,7 @@
void shutdown();
const std::vector< callable > shutdown_now();
- bool terminated();
- bool terminateing();
+ bool closed();
void clear();
bool empty();
std::size_t pending();
@@ -185,7 +184,7 @@
void shutdown();
[variablelist
-[[Effects:] [Changes the pool state to ['terminating], deactivates the channel and joins all worker threads. The status of the pool is assigned to ['terminated] at the end.]]
+[[Effects:] [Deactivates the channel and joins all worker threads. The pool is closed.]]
[[Throws:] [Nothing]]
[[Notes:] [All pending __actions__ are processed.]]
]
@@ -197,30 +196,19 @@
const std::vector< callable > shutdown_now();
[variablelist
-[[Effects:] [Changes the pool state to ['terminating], deactivates the channel, send interruption request to all worker threads and joins them. The status of the pool is assigned to ['terminated] at the end.]]
+[[Effects:] [Deactivates the channel, send interruption request to all worker threads and joins them. The pool is closed.]]
[[Throws:] [Nothing]]
[[Notes:] [Pending __actions__ are not processed but returned.]]
]
[endsect]
-[section:terminated Member function `terminated()`]
+[section:losed Member function `closed()`]
- bool terminated();
+ bool closed();
[variablelist
-[[Effects:] [Queries if the pool is in the terminated state (pool is shutdown).]]
-[[Throws:] [Nothing]]
-]
-[endsect]
-
-
-[section:terminateing Member function `terminateing()`]
-
- bool terminateing();
-
-[variablelist
-[[Effects:] [Queries if the pool is in the terminating state (tries to shutdown the pool).]]
+[[Effects:] [Queries if the pool is closed (pool is shutdown).]]
[[Throws:] [Nothing]]
]
[endsect]
@@ -319,7 +307,7 @@
task< typename result_of< Act() >::type > submit( Act const& act);
[variablelist
-[[Preconditions:] [has_priority< pool >::value == false && ! ( pool.terminating() || pool.terminated() )]]
+[[Preconditions:] [has_priority< pool >::value == false && ! closed()]]
[[Effects:] [Submits an __action__ to the pool and returns a __task__ object.]]
[[Throws:] [`boost::tp::task_rejected`]]
]
@@ -332,7 +320,7 @@
task< typename result_of< Act() >::type > submit( Act const& act, Attr const& attr);
[variablelist
-[[Preconditions:] [has_priority< pool >::value == true && ! ( pool.terminating() || pool.terminated() )]]
+[[Preconditions:] [has_priority< pool >::value == true && ! closed()]]
[[Effects:] [Submits an __action__ to the pool and returns a __task__ object. __Action__ is scheduled by the attribute.]]
[[Throws:] [`boost::tp::task_rejected`]]
]
@@ -355,7 +343,7 @@
task< R > launch_in_pool( Act const& act);
[variablelist
-[[Preconditions:] [has_priority< pool >::value == false && ! ( pool.terminating() || pool.terminated() )]]
+[[Preconditions:] [has_priority< pool >::value == false && ! closed()]]
[[Effects:] [Submits an __action__ to the default pool and returns a __task__ object.]]
[[Throws:] [`boost::tp::task_rejected`]]
]
Modified: sandbox/threadpool/libs/tp/src/guard.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/src/guard.cpp (original)
+++ sandbox/threadpool/libs/tp/src/guard.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -1,18 +1,22 @@
#include "boost/tp/detail/guard.hpp"
+#include <boost/assert.hpp>
+
+#include <boost/tp/detail/atomic.hpp>
+
namespace boost { namespace tp {
namespace detail
{
-guard::guard( volatile uint32_t & active_worker)
+guard::guard( unsigned int & active_worker)
: active_worker_( active_worker)
{
BOOST_ASSERT( active_worker_ >= 0);
- interprocess::detail::atomic_inc32( & active_worker_);
+ atomic_fetch_add( & active_worker_, 1);
}
guard::~guard()
{
- interprocess::detail::atomic_dec32( & active_worker_);
+ atomic_fetch_sub( & active_worker_, 1);
BOOST_ASSERT( active_worker_ >= 0);
}
} } }
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -74,7 +74,7 @@
fibonacci_fn,
10) ) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -110,7 +110,7 @@
tp::high_watermark( 10),
tp::low_watermark( 10) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -146,7 +146,7 @@
boost::this_thread::sleep( pt::millisec( 250) );
BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -74,7 +74,7 @@
fibonacci_fn,
10) ) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -110,7 +110,7 @@
tp::high_watermark( 10),
tp::low_watermark( 10) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -146,7 +146,7 @@
boost::this_thread::sleep( pt::millisec( 250) );
BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -76,7 +76,7 @@
10),
0) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -113,7 +113,7 @@
tp::high_watermark( 10),
tp::low_watermark( 10) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -153,7 +153,7 @@
BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 0) );
BOOST_CHECK_EQUAL( pool.active(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -76,7 +76,7 @@
10),
0) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -113,7 +113,7 @@
tp::high_watermark( 10),
tp::low_watermark( 10) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -153,7 +153,7 @@
BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 0) );
BOOST_CHECK_EQUAL( pool.active(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_lockfree_queue.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_lockfree_queue.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_lockfree_queue.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -70,7 +70,7 @@
fibonacci_fn,
10) ) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -100,7 +100,7 @@
tp::lockfree_channel
> pool( tp::poolsize( 1) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -133,7 +133,7 @@
boost::this_thread::sleep( pt::millisec( 250) );
BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -65,7 +65,7 @@
fibonacci_fn,
10) ) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -95,7 +95,7 @@
tp::unbounded_channel< tp::fifo >
> pool( tp::poolsize( 1) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -128,7 +128,7 @@
boost::this_thread::sleep( pt::millisec( 250) );
BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -65,7 +65,7 @@
fibonacci_fn,
10) ) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -95,7 +95,7 @@
tp::unbounded_channel< tp::lifo >
> pool( tp::poolsize( 1) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -128,7 +128,7 @@
boost::this_thread::sleep( pt::millisec( 250) );
BOOST_CHECK_EQUAL( pool.size(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -67,7 +67,7 @@
10),
0) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -98,7 +98,7 @@
tp::unbounded_channel< tp::priority< int > >
> pool( tp::poolsize( 1) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -135,7 +135,7 @@
BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 0) );
BOOST_CHECK_EQUAL( pool.active(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp 2009-03-15 09:44:38 EDT (Sun, 15 Mar 2009)
@@ -67,7 +67,7 @@
10),
0) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
BOOST_CHECK_EQUAL( t.get(), 55);
}
@@ -98,7 +98,7 @@
tp::unbounded_channel< tp::smart< int, std::less< int >, tp::replace_oldest, tp::take_oldest > >
> pool( tp::poolsize( 1) );
pool.shutdown();
- BOOST_CHECK( pool.terminated() );
+ BOOST_CHECK( pool.closed() );
bool thrown( false);
try
{
@@ -135,7 +135,7 @@
BOOST_CHECK_EQUAL( pool.idle(), std::size_t( 0) );
BOOST_CHECK_EQUAL( pool.active(), std::size_t( 1) );
pool.shutdown_now();
- BOOST_CHECK( pool.terminated() );
+ 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.active(), std::size_t( 0) );
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