17 #ifndef THREADPOOL_DETAIL_WORKER_THREAD_HPP_INCLUDED 18 #define THREADPOOL_DETAIL_WORKER_THREAD_HPP_INCLUDED 23 #include <boost/smart_ptr.hpp> 24 #include <boost/thread.hpp> 25 #include <boost/thread/exceptions.hpp> 26 #include <boost/thread/mutex.hpp> 27 #include <boost/bind.hpp> 30 namespace boost {
namespace threadpool {
namespace detail 43 template <
typename Pool>
45 :
public enable_shared_from_this< worker_thread<Pool> >
71 m_pool->worker_died_unexpectedly(this->shared_from_this());
82 while(m_pool->execute_task()) {}
85 m_pool->worker_destructed(this->shared_from_this());
114 #endif // THREADPOOL_DETAIL_WORKER_THREAD_HPP_INCLUDED The namespace threadpool contains a thread pool and related utility classes.
void died_unexpectedly()
Notifies that an exception occurred in the run loop.
shared_ptr< boost::thread > m_thread
Pointer to the thread which executes the run loop.
Pool pool_type
Indicates the pool's type.
worker_thread(shared_ptr< pool_type > const &pool)
Constructs a new worker.
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
static void create_and_attach(shared_ptr< pool_type > const &pool)
Constructs a new worker thread and attaches it to the pool.
void run()
Executes pool's tasks sequentially.
void join()
Joins the worker's thread.
shared_ptr< pool_type > m_pool
Pointer to the pool which created the worker.