From 824a17fe29b93819632a87ac888fe4c6b09379dd Mon Sep 17 00:00:00 2001 From: thomsj Date: Thu, 27 May 2021 23:47:46 +0100 Subject: [PATCH 1/3] Fix `Task.Delay()` `` 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. --- .../src/System/Threading/Tasks/Task.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index 18a7b33f65679..3c4344e6aec52 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -5480,7 +5480,8 @@ public static Task Run(Func?> function, Cancella /// The is less than -1 or greater than the maximum allowed timer duration. /// /// - /// The provided has already been disposed. + /// The associated CancellationTokenSource + /// of the provided has already been disposed. /// /// /// If the cancellation token is signaled before the specified time delay, then the Task is completed in @@ -5513,7 +5514,8 @@ public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) => /// The is less than -1. /// /// - /// The provided has already been disposed. + /// The associated CancellationTokenSource + /// of the provided has already been disposed. /// /// /// If the cancellation token is signaled before the specified time delay, then the Task is completed in From ba1255aefeee43debbcd237acbc1752d152dbe2e Mon Sep 17 00:00:00 2001 From: James Thomson Date: Fri, 28 May 2021 20:28:08 +0100 Subject: [PATCH 2/3] Use suggested message Co-authored-by: Sam Harwell --- .../System.Private.CoreLib/src/System/Threading/Tasks/Task.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index 3c4344e6aec52..f664acf7a8764 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -5480,8 +5480,8 @@ public static Task Run(Func?> function, Cancella /// The is less than -1 or greater than the maximum allowed timer duration. /// /// - /// The associated CancellationTokenSource - /// of the provided has already been disposed. + /// The associated + /// with has already been disposed. /// /// /// If the cancellation token is signaled before the specified time delay, then the Task is completed in From e316b3f922385685178d7bd01bceb3aa94d9310c Mon Sep 17 00:00:00 2001 From: James Thomson Date: Fri, 28 May 2021 20:32:35 +0100 Subject: [PATCH 3/3] Use suggested message --- .../System.Private.CoreLib/src/System/Threading/Tasks/Task.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index f664acf7a8764..53f0aebf2db20 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -5514,8 +5514,8 @@ public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) => /// The is less than -1. /// /// - /// The associated CancellationTokenSource - /// of the provided has already been disposed. + /// The associated + /// with has already been disposed. /// /// /// If the cancellation token is signaled before the specified time delay, then the Task is completed in