sgns::sgprocessing::CancellationToken¶
#include <execution_context.hpp>
Public Functions¶
| Name | |
|---|---|
| CancellationToken() =default | |
| CancellationToken(const CancellationToken & ) =delete | |
| CancellationToken & | operator=(const CancellationToken & ) =delete |
| CancellationToken(CancellationToken && ) =delete | |
| CancellationToken & | operator=(CancellationToken && ) =delete |
| void | Cancel() |
| bool | IsCancelled() const Returns true after Cancel() has been called. |
| void | SetCallback(std::function< void()> callback) |
Detailed Description¶
Callback-based cooperative cancellation token (D-01, D-02, D-05).
Thread-safe: Cancel() may be called from deadline timer thread while IsCancelled() is read on the processing thread. Uses std::atomic
Public Functions Documentation¶
function CancellationToken¶
function CancellationToken¶
function operator=¶
function CancellationToken¶
function operator=¶
function Cancel¶
Invokes the registered cancel callback (if set) and sets the cancelled flag. The callback is invoked synchronously, at most once.
function IsCancelled¶
Returns true after Cancel() has been called.
function SetCallback¶
Register the cancel callback. Called by ProcessingManager before passing the token to the processor.
Updated on 2026-09-17 at 06:29:14 +0000