CAPD DynSys Library
5.2.0
|
This class realizes a simple thread pool of fixed size. More...
#include <capd/threading/ThreadPool.h>
Public Types | |
typedef std::unique_lock< std::mutex > | UniqueLock |
typedef std::lock_guard< std::mutex > | LockGuard |
Public Member Functions | |
ThreadPool ()=delete | |
Contructor takes number of threads in the pool. More... | |
ThreadPool (const ThreadPool &)=delete | |
ThreadPool (ThreadPool &)=delete | |
ThreadPool (ThreadPool &&)=delete | |
ThreadPool (unsigned noThreads) | |
void | process (Task *task) |
Task submission. It should be a valid pointer to an existing instance od Task. More... | |
void | interrupt () |
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. More... | |
~ThreadPool () | |
void | waitUntilIdle () |
unsigned | poolSize () const |
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.
typedef std::lock_guard<std::mutex> capd::threading::ThreadPool::LockGuard |
typedef std::unique_lock<std::mutex> capd::threading::ThreadPool::UniqueLock |
|
delete |
Contructor takes number of threads in the pool.
|
delete |
|
delete |
|
delete |
|
inlineexplicit |
|
inline |
|
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.
|
inline |
|
inline |
|
inline |