Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

cancellation_token::register_callback Method

Registers a callback function with the token. If and when the token is canceled, the callback will be made. Note that if the token is already canceled at the point where this method is called, the callback will be made immediately and synchronously.

template<
   typename _Function
>
::Concurrency::cancellation_token_registration register_callback(
   const _Function& _Func
) const;

_Function

The type of the function object that will be called back when this cancellation_token is canceled.

_Func

The function object that will be called back when this cancellation_token is canceled.

A cancellation_token_registration object which can be utilized in the deregister method to deregister a previously registered callback and prevent it from being made. The method will throw an invalid_operation exception if it is called on a cancellation_token object that was created using the cancellation_token::none method.

Header: pplcancellation_token.h

Namespace: concurrency

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft