Skip to content

Commit

Permalink
Fix Task.Delay() <exception> XML comments (#53392)
Browse files Browse the repository at this point in the history
* Fix `Task.Delay()` `<exception>` XML comments

Fix `ObjectDisposedException` comments to state that the exception is
thrown when the `CancellationTokenSource` of the `CancellationToken` is
disposed, and not the `CancellationToken` itself.

* Use suggested message

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>

* Use suggested message

Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
  • Loading branch information
thomsj and sharwell committed May 28, 2021
1 parent 422b513 commit 7cb1017
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5480,7 +5480,8 @@ public static Task<TResult> Run<TResult>(Func<Task<TResult>?> function, Cancella
/// The <paramref name="delay"/> is less than -1 or greater than the maximum allowed timer duration.
/// </exception>
/// <exception cref="System.ObjectDisposedException">
/// The provided <paramref name="cancellationToken"/> has already been disposed.
/// The <see cref="CancellationTokenSource"/> associated
/// with <paramref name="cancellationToken"/> has already been disposed.
/// </exception>
/// <remarks>
/// If the cancellation token is signaled before the specified time delay, then the Task is completed in
Expand Down Expand Up @@ -5513,7 +5514,8 @@ public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) =>
/// The <paramref name="millisecondsDelay"/> is less than -1.
/// </exception>
/// <exception cref="System.ObjectDisposedException">
/// The provided <paramref name="cancellationToken"/> has already been disposed.
/// The <see cref="CancellationTokenSource"/> associated
/// with <paramref name="cancellationToken"/> has already been disposed.
/// </exception>
/// <remarks>
/// If the cancellation token is signaled before the specified time delay, then the Task is completed in
Expand Down

0 comments on commit 7cb1017

Please sign in to comment.