#include <ThreadPool.hpp>
|
| | ThreadPool (const uint16_t numThreads) |
| | ~ThreadPool () |
| uint16_t | GetWorkerCount () const |
| | Returns a number of threads allocated for this thread pool.
|
| template<class F, class... Args> |
| std::future< std::invoke_result_t< F, Args... > > | Submit (F &&f, Args &&... args) |
| | Submits a task to be executed on the thread of this thread pool.
|
Definition at line 7 of file ThreadPool.hpp.
◆ ThreadPool()
| Cori::Core::Threading::ThreadPool::ThreadPool |
( |
const uint16_t | numThreads | ) |
|
|
inlineexplicit |
◆ ~ThreadPool()
| Cori::Core::Threading::ThreadPool::~ThreadPool |
( |
| ) |
|
|
inline |
◆ GetWorkerCount()
| uint16_t Cori::Core::Threading::ThreadPool::GetWorkerCount |
( |
| ) |
const |
|
inline |
Returns a number of threads allocated for this thread pool.
- Returns
- Number of threads.
Definition at line 48 of file ThreadPool.hpp.
◆ Submit()
template<class F, class... Args>
| std::future< std::invoke_result_t< F, Args... > > Cori::Core::Threading::ThreadPool::Submit |
( |
F && | f, |
|
|
Args &&... | args ) |
|
inline |
Submits a task to be executed on the thread of this thread pool.
It is safe to call this function from any thread.
- Template Parameters
-
| F | Auto deduced callable type. |
| Args | Auto deduced callable argument types. |
- Parameters
-
| f | Task callable, no specific signature required. |
| args | Arguments that will be passed to the callable task upon execution. |
- Returns
- Future that will hold the result of invoke result of the passed callable.
Definition at line 62 of file ThreadPool.hpp.
The documentation for this class was generated from the following file: