dotnet / dotnet/dotnet-api-docs

TaskCompletionSource TrySetResult incorrectly states it will return false is the Task is disposed

Open
#8,108 4 comments 0 reactions 1 assignee Claimed by @buyaa-n View on GitHub
area-System.Threading.Tasks Pri3
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

The below line also contradicts that it will actually throw a DisposedException if the Task is disposed.

This method also returns false if the underlying has already been disposed.

Checking this, seems to verify that it will throw instead of returning false:
https://referencesource.microsoft.com/#mscorlib/system/threading/Tasks/TaskCompletionSource.cs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.