Open PaintThis opened 2 years ago
Tagging subscribers to this area: @dotnet/area-system-threading-tasks See info in area-owners.md if you want to be subscribed.
Author: | PaintThis |
---|---|
Assignees: | - |
Labels: | `untriaged`, `Pri3`, `area-System.Threading.Tasks` |
Milestone: | - |
It is correct that TrySetResult will return false if the Task was disposed. (This falls out from the fact that you can only call Dispose on a task that has already completed, and TrySetResult will return false if the task has already completed).
It is incorrect that TrySetResult will throw if the Task was disposed. That Exceptions portion of the docs should be stricken.
The source doc looks correct, seems the doc repo kept old doc from .Net framework source. https://github.com/dotnet/runtime/blob/3439e2ce9b2dbb7649b44136de7ddad140471289/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskCompletionSource.cs#L204-L214
@carlossanlop is there a tool I can use to update / sync source doc with doc repo, I know you run a tool each release, but seems that is apply/work only for new APIs
but seems that is apply/work only for new APIs
That is correct, the tool only ports new documentation from triple slash to dotnet-api-docs. It won't overwrite anything in dotnet-api-docs.
Updates to existing docs need to be made manually.
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 <xref:System.Threading.Tasks.Task%601> 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