|
ThreadSchedule 1.0.0
Modern C++ thread management library
|
Copyable handle for a cancellable scheduled task. More...
#include <scheduled_pool.hpp>
Public Member Functions | |
| ScheduledTaskHandle (uint64_t id) | |
| void | cancel () |
| auto | is_cancelled () const noexcept -> bool |
| auto | id () const noexcept -> uint64_t |
Friends | |
| template<typename> | |
| class | ScheduledThreadPoolT |
Copyable handle for a cancellable scheduled task.
Copyable (the cancel flag is shared via std::shared_ptr<std::atomic<bool>>). Both cancel() and is_cancelled() are thread-safe (atomic store / load with release / acquire ordering).
Cancellation is cooperative: the scheduler checks the flag before dispatching the task to the worker pool, but a task that is already executing will not be interrupted.
Definition at line 28 of file scheduled_pool.hpp.
|
inlineexplicit |
Definition at line 31 of file scheduled_pool.hpp.
|
inline |
Definition at line 35 of file scheduled_pool.hpp.
|
inlinenodiscardnoexcept |
Definition at line 45 of file scheduled_pool.hpp.
|
inlinenodiscardnoexcept |
Definition at line 40 of file scheduled_pool.hpp.
|
friend |
Definition at line 55 of file scheduled_pool.hpp.