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

Require TaskCreationOptions.RunContinuationsAsynchronously #83

Open
bgrainger opened this issue Oct 31, 2022 · 0 comments
Open

Require TaskCreationOptions.RunContinuationsAsynchronously #83

bgrainger opened this issue Oct 31, 2022 · 0 comments

Comments

@bgrainger
Copy link
Member

According to The danger of TaskCompletionSource class:

  • TaskCompletionSource instances created with default constructor may cause deadlocks and other threading issues by running all “async” continuations in the thread that sets the result of a task.
  • If you use .NET 4.6.1+ you should always provide TaskCreationOptions.RunContinuationsAsynchronously when creating TaskCompletionSource instances.

Add an analyzer that enforces this recommendation.

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

No branches or pull requests

1 participant