LuciadCPillar 2023.1.04
|
A task that can be canceled. More...
#include <luciad/concurrent/CancellationToken.h>
Public Member Functions | |
virtual | ~ICancellableTask ()=default |
virtual void | cancel ()=0 |
Signals that the task should be canceled. More... | |
virtual void | run ()=0 |
Executes the cancellable task and waits for it to finish. More... | |
A task that can be canceled.
The task is launched by calling the run() method. While the task is executing, if another thread calls the cancel() method of that task, then it gets the opportunity to signal that the run() method should stop executing and return early. This can be achieved either by e.g. setting an atomic flag that the run method will periodically check, or by calling a specific abort method on an external API (e.g. a Http request class).
|
virtualdefault |
|
pure virtual |
|
pure virtual |
Executes the cancellable task and waits for it to finish.
This call is synchronous, and thus blocking.