/brief Handle for a task executed by ThreadPool
More...
#include <ThreadPool.h>
|
| void | join () const |
| | Block the current thread and wait for the associated task to finish.
|
| |
|
| bool | m_is_finished = false |
| | Indicates whether the task execution has finished.
|
| |
| std::condition_variable | m_finish_cv |
| | Used to signal the current thread when the task has finished.
|
| |
| std::mutex | m_task_mutex |
| | Mutex which is locked while the task is running.
|
| |
| const std::function< void()> | m_task_func |
| | Callable object which implements the task to execute.
|
| |
/brief Handle for a task executed by ThreadPool
Returned by ThreadPool instance when submitting a new task to run. Provides a thin wrapper around the callable object which implements the actual task. Allows for synchronization, i.e. to wait for the associated task to finish (see join()).
- See also
- ThreadPool
Definition at line 44 of file ThreadPool.h.
◆ Task() [1/2]
| RoR::Task::Task |
( |
std::function< void()> |
task_func | ) |
|
|
inlineprivate |
◆ Task() [2/2]
| RoR::Task::Task |
( |
Task & |
| ) |
|
|
privatedelete |
◆ join()
| void RoR::Task::join |
( |
| ) |
const |
|
inline |
Block the current thread and wait for the associated task to finish.
Definition at line 49 of file ThreadPool.h.
◆ operator=()
◆ ThreadPool
◆ m_finish_cv
| std::condition_variable RoR::Task::m_finish_cv |
|
mutableprivate |
Used to signal the current thread when the task has finished.
Definition at line 76 of file ThreadPool.h.
◆ m_is_finished
| bool RoR::Task::m_is_finished = false |
|
private |
Indicates whether the task execution has finished.
Definition at line 75 of file ThreadPool.h.
◆ m_task_func
| const std::function<void()> RoR::Task::m_task_func |
|
private |
Callable object which implements the task to execute.
Definition at line 78 of file ThreadPool.h.
◆ m_task_mutex
| std::mutex RoR::Task::m_task_mutex |
|
mutableprivate |
Mutex which is locked while the task is running.
Definition at line 77 of file ThreadPool.h.
The documentation for this class was generated from the following file: