|
|
The ThreadPool class. More...
#include <ArmarXCore/core/services/tasks/ThreadPool.h>
Classes | |
| class | Handle |
| struct | Impl |
Public Member Functions | |
| int | getAvailableTaskCount () const |
| If queing is disabled, returns the number of available threads. More... | |
| Handle | runTask (std::function< void()> task) |
| Adds a task to the thread pool if a thread is currently available. More... | |
| ThreadPool (std::size_t pool_size, bool queueTasks=false) | |
| Constructor. More... | |
| ~ThreadPool () | |
| Destructor. More... | |
| ThreadPool | ( | std::size_t | pool_size, |
| bool | queueTasks = false |
||
| ) |
Constructor.
Definition at line 56 of file ThreadPool.cpp.
| ~ThreadPool | ( | ) |
Destructor.
Definition at line 66 of file ThreadPool.cpp.
| int getAvailableTaskCount | ( | ) | const |
If queing is disabled, returns the number of available threads.
Otherwise returns -1;
Definition at line 109 of file ThreadPool.cpp.
| ThreadPool::Handle runTask | ( | std::function< void()> | task | ) |
Adds a task to the thread pool if a thread is currently available.
Definition at line 82 of file ThreadPool.cpp.