#include <PndLmdThreadPool.h>
Definition at line 18 of file PndLmdThreadPool.h.
◆ PndLmdThreadPool() [1/2]
PndLmdThreadPool::PndLmdThreadPool |
( |
| ) |
|
|
inline |
Definition at line 37 of file PndLmdThreadPool.h.
References i.
39 for (
unsigned i = 0;
i < boost::thread::hardware_concurrency(); ++
i)
40 pool.create_thread(boost::bind(worker_thread, boost::ref(*
this)));
◆ PndLmdThreadPool() [2/2]
PndLmdThreadPool::PndLmdThreadPool |
( |
unsigned int |
maxThreads | ) |
|
|
inline |
Definition at line 44 of file PndLmdThreadPool.h.
References i.
46 if (maxThreads > boost::thread::hardware_concurrency() || maxThreads == 0)
47 maxThreads = boost::thread::hardware_concurrency();
48 for (
unsigned i = 0;
i < maxThreads; ++
i)
49 pool.create_thread(boost::bind(worker_thread, boost::ref(*
this)));
◆ ~PndLmdThreadPool()
PndLmdThreadPool::~PndLmdThreadPool |
( |
| ) |
|
|
inline |
◆ dequeue()
boost::optional<job_t> PndLmdThreadPool::dequeue |
( |
| ) |
|
|
inline |
Definition at line 59 of file PndLmdThreadPool.h.
61 boost::unique_lock<boost::mutex> lk(mx);
62 namespace phx = boost::phoenix;
63 cv.wait(lk, phx::ref(shutdown) || !phx::empty(phx::ref(_queue)));
66 job_t job = _queue.front();
◆ enqueue()
void PndLmdThreadPool::enqueue |
( |
job_t |
job | ) |
|
|
inline |
Definition at line 52 of file PndLmdThreadPool.h.
54 boost::lock_guard<boost::mutex> lk(mx);
55 _queue.push_back(job);
◆ wait()
void PndLmdThreadPool::wait |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: