System::Threading::CancellationToken::Register method

CancellationToken::Register method

Registers a callback that will be invoked when cancellation is requested.

CancellationTokenRegistration System::Threading::CancellationToken::Register(const Action<> &callback) const
ParameterTypeDescription
callbackconst Action<>&The Action<> to execute when cancellation is requested.

ReturnValue

A CancellationTokenRegistration object that can be used to deregister the callback.

Remarks

If cancellation has already been requested, the callback will be invoked immediately.

See Also