Thread pool worker.
More...
#include <thread_pool.hpp>
|
| | worker (thread_pool &pool, uint16_t id) |
| | Create a thread pool worker.
|
| |
| std::size_t | id () const noexcept |
| | Return ID of the worker.
|
| |
| task_t * | submit (auto &&func, task_t *parent=nullptr) |
| | Submit a task into local workers queue.
|
| |
| void | submit (task_t *task) |
| | Submit a task into local workers queue.
|
| |
| void | wait (task_t *task) |
| | Wait for task completion.
|
| |
◆ worker()
| co_ecs::thread_pool::worker::worker |
( |
thread_pool & | pool, |
|
|
uint16_t | id ) |
|
inline |
Create a thread pool worker.
- Parameters
-
◆ current()
| static worker & co_ecs::thread_pool::worker::current |
( |
| ) |
|
|
inlinestaticnoexcept |
Get current thread worker.
- Returns
- Returns a worker dedicated to the thread this method is invoked from
◆ id()
| std::size_t co_ecs::thread_pool::worker::id |
( |
| ) |
const |
|
inlinenoexcept |
Return ID of the worker.
- Returns
- Worker ID
◆ submit() [1/2]
| task_t * co_ecs::thread_pool::worker::submit |
( |
auto && | func, |
|
|
task_t * | parent = nullptr ) |
|
inline |
Submit a task into local workers queue.
- Parameters
-
| func | Function |
| parent | Parent task pointer |
◆ submit() [2/2]
| void co_ecs::thread_pool::worker::submit |
( |
task_t * | task | ) |
|
|
inline |
Submit a task into local workers queue.
- Parameters
-
◆ wait()
| void co_ecs::thread_pool::worker::wait |
( |
task_t * | task | ) |
|
|
inline |
Wait for task completion.
- Parameters
-
◆ thread_pool
The documentation for this class was generated from the following file: