Task to be executed by one of available threads.
More...
#include <Pool.h>
Task to be executed by one of available threads.
Definition at line 20 of file Pool.h.
◆ Task()
Task::Task |
( |
const Function< void()> & |
callable | ) |
|
|
explicit |
◆ ~Task()
◆ completed()
bool Task::completed |
( |
| ) |
const |
|
overridevirtual |
Checks if the task already finished.
Implements ITask.
Definition at line 48 of file Pool.cpp.
◆ getCurrent()
Returns the currently execute task, or nullptr if no task is currently executed on this thread.
Definition at line 60 of file Pool.cpp.
◆ getParent()
◆ isRoot()
bool Task::isRoot |
( |
| ) |
const |
Returns true if this is the top-most task.
Definition at line 52 of file Pool.cpp.
◆ runAndNotify()
void Task::runAndNotify |
( |
| ) |
|
◆ setException()
void Task::setException |
( |
std::exception_ptr |
exception | ) |
|
Saves exception into the task.
The exception propagates into the top-most task.
Definition at line 75 of file Pool.cpp.
◆ setParent()
Assigns a task that spawned this task.
Can be nullptr if this is the root task.
Definition at line 64 of file Pool.cpp.
◆ wait()
Waits till the task and all the child tasks are completed.
Implements ITask.
Definition at line 28 of file Pool.cpp.
The documentation for this class was generated from the following files:
- /home/pavel/projects/astro/sph/src/core/thread/Pool.h
- /home/pavel/projects/astro/sph/src/core/thread/Pool.cpp