#include <PndLmdThreadPool.h>
|
typedef boost::function< void()> | job_t |
|
Definition at line 18 of file PndLmdThreadPool.h.
PndLmdThreadPool::PndLmdThreadPool |
( |
| ) |
|
|
inline |
Definition at line 36 of file PndLmdThreadPool.h.
References i.
38 for (
unsigned i = 0;
i < boost::thread::hardware_concurrency(); ++
i)
static void worker_thread(PndLmdThreadPool &q)
boost::atomic_bool shutdown
PndLmdThreadPool::PndLmdThreadPool |
( |
unsigned int |
maxThreads | ) |
|
|
inline |
Definition at line 43 of file PndLmdThreadPool.h.
References i.
45 if (maxThreads > boost::thread::hardware_concurrency() || maxThreads == 0) maxThreads =
46 boost::thread::hardware_concurrency();
47 for (
unsigned i = 0;
i < maxThreads; ++
i)
static void worker_thread(PndLmdThreadPool &q)
boost::atomic_bool shutdown
PndLmdThreadPool::~PndLmdThreadPool |
( |
| ) |
|
|
inline |
Definition at line 77 of file PndLmdThreadPool.h.
80 boost::lock_guard<boost::mutex> lk(
mx);
boost::condition_variable cv
boost::atomic_bool shutdown
boost::optional<job_t> PndLmdThreadPool::dequeue |
( |
| ) |
|
|
inline |
Definition at line 57 of file PndLmdThreadPool.h.
Referenced by worker_thread().
58 boost::unique_lock<boost::mutex> lk(
mx);
59 namespace phx = boost::phoenix;
61 if (
_queue.empty())
return boost::none;
std::deque< job_t > _queue
boost::condition_variable cv
boost::atomic_bool shutdown
boost::function< void()> job_t
void PndLmdThreadPool::enqueue |
( |
job_t |
job | ) |
|
|
inline |
void PndLmdThreadPool::wait |
( |
| ) |
|
|
inline |
std::deque<job_t> PndLmdThreadPool::_queue |
|
private |
boost::condition_variable PndLmdThreadPool::cv |
|
private |
boost::mutex PndLmdThreadPool::mx |
|
private |
boost::thread_group PndLmdThreadPool::pool |
|
private |
boost::atomic_bool PndLmdThreadPool::shutdown |
|
private |
The documentation for this class was generated from the following file: