This class realizes a simple thread pool of fixed size.
More...
#include <capd/threading/ThreadPool.h>
|
typedef std::unique_lock< std::mutex > | UniqueLock |
|
typedef std::lock_guard< std::mutex > | LockGuard |
|
This class realizes a simple thread pool of fixed size.
All the threads are keeped alive until the instance of ThreadPool exists or it has been marked as interrupted.
◆ LockGuard
◆ UniqueLock
◆ ThreadPool() [1/5]
capd::threading::ThreadPool::ThreadPool |
( |
| ) |
|
|
delete |
Contructor takes number of threads in the pool.
◆ ThreadPool() [2/5]
capd::threading::ThreadPool::ThreadPool |
( |
const ThreadPool & |
| ) |
|
|
delete |
◆ ThreadPool() [3/5]
capd::threading::ThreadPool::ThreadPool |
( |
ThreadPool & |
| ) |
|
|
delete |
◆ ThreadPool() [4/5]
capd::threading::ThreadPool::ThreadPool |
( |
ThreadPool && |
| ) |
|
|
delete |
◆ ThreadPool() [5/5]
capd::threading::ThreadPool::ThreadPool |
( |
unsigned |
noThreads | ) |
|
|
inlineexplicit |
◆ ~ThreadPool()
capd::threading::ThreadPool::~ThreadPool |
( |
| ) |
|
|
inline |
◆ interrupt()
void capd::threading::ThreadPool::interrupt |
( |
| ) |
|
|
inline |
This method marks a ThreadPool for interruption. The tasks already running may continue for a while (even they can complete). No new tasks will be started after call to interrupt. Submissions of new tasks to an interrupted ThreadPool leads in throwing an exception.
◆ poolSize()
unsigned capd::threading::ThreadPool::poolSize |
( |
| ) |
const |
|
inline |
◆ process()
void capd::threading::ThreadPool::process |
( |
Task * |
task | ) |
|
|
inline |
Task submission. It should be a valid pointer to an existing instance od Task.
◆ waitUntilIdle()
void capd::threading::ThreadPool::waitUntilIdle |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: