Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create cancellation token registration wrapper only when it's needed #45075

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

marek-safar
Copy link
Contributor

instead of doing it eagerly in static ctor

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial reaction was "no, this is often used on hot paths", but upon reflection, if you're using the Action rather than Action<object>, you're likely already incurring overheads that make this unsuitable to hot paths. So, LGTM.

…ellationToken.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
@marek-safar marek-safar merged commit 7218577 into dotnet:master Nov 23, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants