|
ThreadSchedule 2.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 33 of file scheduled_pool.hpp.
|
inlineexplicit |
Definition at line 36 of file scheduled_pool.hpp.
References id().
|
inline |
Definition at line 40 of file scheduled_pool.hpp.
Referenced by threadschedule::ScheduledThreadPoolT< ThreadPool >::cancel().
|
inlinenodiscardnoexcept |
Definition at line 50 of file scheduled_pool.hpp.
Referenced by ScheduledTaskHandle().
|
inlinenodiscardnoexcept |
Definition at line 45 of file scheduled_pool.hpp.
|
friend |
Definition at line 60 of file scheduled_pool.hpp.
References ScheduledThreadPoolT.
Referenced by ScheduledThreadPoolT.