Skip to content

Conversation

@oldnewthing
Copy link
Member

@oldnewthing oldnewthing commented Jun 29, 2020

Allow revoking cancellation callback by setting it to null. This is important if a late callback could end up accessing an already-destructed object. Previously, the only way to revoke a cancellation callback was to replace it with a nop delegate [](), which is clunky.

Make the token's callback method const. This makes it easier to capture a token into a lambda.

This is important if a late callback could end up accessing
an already-destructed object. Previously, the only way
to revoke a cancellation callback was to replace it with
a nop delegate `[]()`, which is clunky.
That way you can use a captured cancellation token
from a lambda.
@oldnewthing oldnewthing changed the title Allow revoking cancellation callback by setting it to null Cancellation token improvements Jun 29, 2020
@kennykerr
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants