35 #ifndef _BLAZE_UTIL_THREAD_H_
36 #define _BLAZE_UTIL_THREAD_H_
43 #include <boost/scoped_ptr.hpp>
44 #include <boost/thread/thread.hpp>
218 template<
typename Callable >
219 explicit inline Thread( Callable func );
221 template<
typename Callable,
typename A1 >
222 explicit inline Thread( Callable func, A1 a1 );
224 template<
typename Callable,
typename A1,
typename A2 >
225 explicit inline Thread( Callable func, A1 a1, A2 a2 );
227 template<
typename Callable,
typename A1,
typename A2,
typename A3 >
228 explicit inline Thread( Callable func, A1 a1, A2 a2, A3 a3 );
230 template<
typename Callable,
typename A1,
typename A2,
typename A3,
typename A4 >
231 explicit inline Thread( Callable func, A1 a1, A2 a2, A3 a3, A4 a4 );
233 template<
typename Callable,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5 >
234 explicit inline Thread( Callable func, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 );
305 template<
typename Callable >
310 thread_.reset(
new boost::thread( func ) );
325 template<
typename Callable
331 thread_.reset(
new boost::thread( func, a1 ) );
347 template<
typename Callable
354 thread_.reset(
new boost::thread( func, a1, a2 ) );
371 template<
typename Callable
379 thread_.reset(
new boost::thread( func, a1, a2, a3 ) );
397 template<
typename Callable
406 thread_.reset(
new boost::thread( func, a1, a2, a3, a4 ) );
425 template<
typename Callable
435 thread_.reset(
new boost::thread( func, a1, a2, a3, a4, a5 ) );
Base class for non-copyable class instances.
~Thread()
Destructor for the Thread class.
Definition: Thread.cpp:90
ThreadHandle thread_
Handle to the thread of execution.
Definition: Thread.h:276
Base class for non-copyable class instances.The NonCopyable class is intended to work as a base class...
Definition: NonCopyable.h:63
ThreadPool * pool_
Handle to the managing thread pool.
Definition: Thread.h:275
Implementation of a single thread of execution.
Definition: Thread.h:200
void run()
Execution function for threads in a thread pool.
Definition: Thread.cpp:108
bool joinable() const
Returns whether this is a thread of execution.
Definition: Thread.h:457
volatile bool terminated_
Thread termination flag.
Definition: Thread.h:271
boost::scoped_ptr< boost::thread > ThreadHandle
Handle for a single thread.
Definition: Thread.h:204
Thread(ThreadPool *pool)
Starting a thread in a thread pool.
Definition: Thread.cpp:69
void join()
Waiting for a thread of execution to complete.
Definition: Thread.h:472
bool hasTerminated() const
Returns whether the thread has terminated its execution.
Definition: Thread.h:487
Implementation of a thread pool.
Definition: ThreadPool.h:232