18 #ifndef THREADPOOL_SIZE_POLICIES_HPP_INCLUDED 19 #define THREADPOOL_SIZE_POLICIES_HPP_INCLUDED 24 namespace boost {
namespace threadpool
31 template<
typename Pool>
42 template<
typename Pool >
58 return m_policy.get().resize(worker_count);
67 template<
typename Pool>
70 reference_wrapper<Pool volatile>
m_pool;
73 static void init(Pool&
pool,
size_t const worker_count)
75 pool.resize(worker_count);
82 bool resize(
size_t const worker_count)
84 return m_pool.get().resize(worker_count);
89 m_pool.get().resize(new_worker_count + 1);
99 #endif // THREADPOOL_SIZE_POLICIES_HPP_INCLUDED
reference_wrapper< Pool volatile > m_pool
The namespace threadpool contains a thread pool and related utility classes.
empty_controller(typename Pool::size_policy_type &, shared_ptr< Pool >)
static_size(Pool volatile &pool)
bool resize(size_t const worker_count)
Pool::size_policy_type size_policy_type
bool resize(size_t worker_count)
SizePolicyController which allows resizing.
SizePolicy which preserves the thread count.
void worker_died_unexpectedly(size_t const new_worker_count)
SizePolicyController which provides no functionality.
shared_ptr< Pool > m_pool
to make sure that the pool is alive (the policy pointer is valid) as long as the controller exists ...
static void init(Pool &pool, size_t const worker_count)
resize_controller(size_policy_type &policy, shared_ptr< Pool > pool)
reference_wrapper< size_policy_type > m_policy