Move-only owner of a cancellation state. More...
#include <cancel.hpp>
Public Member Functions | |
| CancelSource () | |
| ~CancelSource () | |
| CancelSource (const CancelSource &)=delete | |
| CancelSource & | operator= (const CancelSource &)=delete |
| CancelSource (CancelSource &&other) noexcept=default | |
| CancelSource & | operator= (CancelSource &&other) noexcept |
| Cancels the state this source currently owns, then takes over other. | |
| CancelToken | token () const noexcept |
| Observer for this source. Tokens remain valid after the source dies. | |
| bool | cancel () noexcept |
| Signal cancellation. | |
| bool | is_cancelled () const noexcept |
Move-only owner of a cancellation state.
Cancels when destroyed, so work observing a token never outlives the scope that owns the source without being told to stop.
| pulp::runtime::CancelSource::CancelSource | ( | ) |
| pulp::runtime::CancelSource::~CancelSource | ( | ) |
|
delete |
|
defaultnoexcept |
|
noexcept |
Signal cancellation.
Idempotent. Returns true if this call was the one that cancelled. Wakes wait_for_cancellation callers and runs registered callbacks on the calling thread.
|
inlinenodiscardnoexcept |
|
noexcept |
Cancels the state this source currently owns, then takes over other.
|
delete |
|
inlinenodiscardnoexcept |
Observer for this source. Tokens remain valid after the source dies.