22 #ifndef _BLAZE_UTIL_THREADPOOL_THREADPOOL_H_
23 #define _BLAZE_UTIL_THREADPOOL_THREADPOOL_H_
30 #include <boost/bind.hpp>
31 #include <boost/thread/condition.hpp>
32 #include <boost/thread/mutex.hpp>
33 #include <boost/type_traits.hpp>
34 #include <boost/utility/result_of.hpp>
229 typedef Mutex::scoped_lock
Lock;
252 inline size_t size()
const;
253 inline size_t active()
const;
254 inline size_t ready()
const;
261 template<
typename Callable >
264 template<
typename Callable,
typename A1 >
265 void schedule( Callable func, A1 a1 );
267 template<
typename Callable,
typename A1,
typename A2 >
268 void schedule( Callable func, A1 a1, A2 a2 );
270 template<
typename Callable,
typename A1,
typename A2,
typename A3 >
271 void schedule( Callable func, A1 a1, A2 a2, A3 a3 );
273 template<
typename Callable,
typename A1,
typename A2,
typename A3,
typename A4 >
274 void schedule( Callable func, A1 a1, A2 a2, A3 a3, A4 a4 );
276 template<
typename Callable,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5 >
277 void schedule( Callable func, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 );
401 template<
typename Callable >
405 BLAZE_STATIC_ASSERT( boost::is_void<
typename boost::result_of<Callable()>::type >::value );
411 TaskID task(
new FuncWrapper<Callable>( func ) );
428 template<
typename Callable
433 BLAZE_STATIC_ASSERT( boost::is_void<
typename boost::result_of<Callable()>::type >::value );
439 TaskID task(
new FuncWrapper<Callable>( boost::bind( func, a1 ) ) );
457 template<
typename Callable
463 BLAZE_STATIC_ASSERT( boost::is_void<
typename boost::result_of<Callable()>::type >::value );
469 TaskID task(
new FuncWrapper<Callable>( boost::bind( func, a1, a2 ) ) );
488 template<
typename Callable
495 BLAZE_STATIC_ASSERT( boost::is_void<
typename boost::result_of<Callable()>::type >::value );
501 TaskID task(
new FuncWrapper<Callable>( boost::bind( func, a1, a2, a3 ) ) );
521 template<
typename Callable
529 BLAZE_STATIC_ASSERT( boost::is_void<
typename boost::result_of<Callable()>::type >::value );
535 TaskID task(
new FuncWrapper<Callable>( boost::bind( func, a1, a2, a3, a4 ) ) );
556 template<
typename Callable
565 BLAZE_STATIC_ASSERT( boost::is_void<
typename boost::result_of<Callable()>::type >::value );
571 TaskID task(
new FuncWrapper<Callable>( boost::bind( func, a1, a2, a3, a4, a5 ) ) );