共用方式為


cancellation_token_source Class

The cancellation_token_source class represents the ability to cancel some cancelable operation.

class cancellation_token_source;

Members

Public Constructors

Name

Description

cancellation_token_source::cancellation_token_source Constructor

Overloaded. Constructs a new cancellation_token_source. The source can be used to flag cancellation of some cancelable operation.

cancellation_token_source::~cancellation_token_source Destructor

Public Methods

Name

Description

cancellation_token_source::cancel Method

Cancels the token. Any task_group, structured_task_group, or task which utilizes the token will be canceled upon this call and throw an exception at the next interruption point.

cancellation_token_source::create_linked_source Method

Overloaded. Creates a cancellation_token_source which is canceled when the provided token is canceled.

cancellation_token_source::get_token Method

Returns a cancellation token associated with this source. The returned token can be polled for cancellation or provide a callback if and when cancellation occurs.

Public Operators

Name

Description

cancellation_token_source::operator!= Operator

cancellation_token_source::operator= Operator

cancellation_token_source::operator== Operator

Inheritance Hierarchy

cancellation_token_source

Requirements

Header: pplcancellation_token.h

Namespace: concurrency

See Also

Reference

concurrency Namespace