The Gaudi Framework
v29r0 (ff2e7097)
|
Thread pool worker. More...
#include <src/threadpool/boost/threadpool/detail/worker_thread.hpp>
Public Types | |
typedef Pool | pool_type |
Indicates the pool's type. More... | |
Public Member Functions | |
void | run () |
Executes pool's tasks sequentially. More... | |
void | join () |
Joins the worker's thread. More... | |
Static Public Member Functions | |
static void | create_and_attach (shared_ptr< pool_type > const &pool) |
Constructs a new worker thread and attaches it to the pool. More... | |
Private Member Functions | |
worker_thread (shared_ptr< pool_type > const &pool) | |
Constructs a new worker. More... | |
void | died_unexpectedly () |
Notifies that an exception occurred in the run loop. More... | |
Private Attributes | |
shared_ptr< pool_type > | m_pool |
Pointer to the pool which created the worker. More... | |
shared_ptr< boost::thread > | m_thread |
Pointer to the thread which executes the run loop. More... | |
Thread pool worker.
A worker_thread represents a thread of execution. The worker is attached to a thread pool and processes tasks of that pool. The lifetime of the worker and its internal boost::thread is managed automatically.
This class is a helper class and cannot be constructed or accessed directly.
Definition at line 44 of file worker_thread.hpp.
typedef Pool boost::threadpool::detail::worker_thread< Pool >::pool_type |
Indicates the pool's type.
Definition at line 49 of file worker_thread.hpp.
|
inlineprivate |
Constructs a new worker.
pool | Pointer to it's parent pool. |
Definition at line 60 of file worker_thread.hpp.
|
inlinestatic |
Constructs a new worker thread and attaches it to the pool.
pool | Pointer to the pool. |
Definition at line 100 of file worker_thread.hpp.
|
inlineprivate |
Notifies that an exception occurred in the run loop.
Definition at line 69 of file worker_thread.hpp.
|
inline |
Joins the worker's thread.
Definition at line 91 of file worker_thread.hpp.
|
inline |
Executes pool's tasks sequentially.
Definition at line 78 of file worker_thread.hpp.
|
private |
Pointer to the pool which created the worker.
Definition at line 52 of file worker_thread.hpp.
|
private |
Pointer to the thread which executes the run loop.
Definition at line 53 of file worker_thread.hpp.