Skip to content

Commit 3369f85

Browse files
authored
Clarify scope of cancellation in Task.Run (#4253)
1 parent 0ab1ab3 commit 3369f85

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

xml/System.Threading.Tasks/Task.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,8 +3447,8 @@ Task t Status: RanToCompletion, Result: 42
34473447
</Parameters>
34483448
<Docs>
34493449
<param name="action">The work to execute asynchronously</param>
3450-
<param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
3451-
<summary>Queues the specified work to run on the thread pool and returns a <see cref="T:System.Threading.Tasks.Task" /> object that represents that work. A cancellation token allows the work to be cancelled.</summary>
3450+
<param name="cancellationToken">A cancellation token that can be used to cancel the work if it has not yet started. <see cref="M:System.Threading.Tasks.Task.Run(System.Action,System.Threading.CancellationToken)" /> does not pass <paramref name="cancellationToken" /> to <paramref name="action" />.</param>
3451+
<summary>Queues the specified work to run on the thread pool and returns a <see cref="T:System.Threading.Tasks.Task" /> object that represents that work. A cancellation token allows the work to be cancelled if it has not yet started.</summary>
34523452
<returns>A task that represents the work queued to execute in the thread pool.</returns>
34533453
<remarks>
34543454
<format type="text/markdown"><![CDATA[
@@ -3520,8 +3520,8 @@ Task t Status: RanToCompletion, Result: 42
35203520
</Parameters>
35213521
<Docs>
35223522
<param name="function">The work to execute asynchronously.</param>
3523-
<param name="cancellationToken">A cancellation token that should be used to cancel the work.</param>
3524-
<summary>Queues the specified work to run on the thread pool and returns a proxy for the task returned by <paramref name="function" />.</summary>
3523+
<param name="cancellationToken">A cancellation token that can be used to cancel the work if it has not yet started. <see cref="M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken)" /> does not pass <paramref name="cancellationToken" /> to <paramref name="action" />.</param>
3524+
<summary>Queues the specified work to run on the thread pool and returns a proxy for the task returned by <paramref name="function" />. A cancellation token allows the work to be cancelled if it has not yet started.</summary>
35253525
<returns>A task that represents a proxy for the task returned by <paramref name="function" />.</returns>
35263526
<remarks>
35273527
<format type="text/markdown"><![CDATA[
@@ -3581,7 +3581,7 @@ Task t Status: RanToCompletion, Result: 42
35813581
<Docs>
35823582
<typeparam name="TResult">The type of the result returned by the proxy task.</typeparam>
35833583
<param name="function">The work to execute asynchronously</param>
3584-
<summary>Queues the specified work to run on the thread pool and returns a proxy for the <see langword="Task(TResult)" /> returned by <paramref name="function" />.</summary>
3584+
<summary>Queues the specified work to run on the thread pool and returns a proxy for the <see langword="Task(TResult)" /> returned by <paramref name="function" />. A cancellation token allows the work to be cancelled if it has not yet started.</summary>
35853585
<returns>A <see langword="Task(TResult)" /> that represents a proxy for the <see langword="Task(TResult)" /> returned by <paramref name="function" />.</returns>
35863586
<remarks>
35873587
<format type="text/markdown"><![CDATA[
@@ -3637,7 +3637,7 @@ Task t Status: RanToCompletion, Result: 42
36373637
<Docs>
36383638
<typeparam name="TResult">The return type of the task.</typeparam>
36393639
<param name="function">The work to execute asynchronously.</param>
3640-
<summary>Queues the specified work to run on the thread pool and returns a <see cref="T:System.Threading.Tasks.Task`1" /> object that represents that work.</summary>
3640+
<summary>Queues the specified work to run on the thread pool and returns a <see cref="T:System.Threading.Tasks.Task`1" /> object that represents that work. A cancellation token allows the work to be cancelled if it has not yet started.</summary>
36413641
<returns>A task object that represents the work queued to execute in the thread pool.</returns>
36423642
<remarks>
36433643
<format type="text/markdown"><![CDATA[
@@ -3713,7 +3713,7 @@ Task t Status: RanToCompletion, Result: 42
37133713
<Docs>
37143714
<typeparam name="TResult">The type of the result returned by the proxy task.</typeparam>
37153715
<param name="function">The work to execute asynchronously</param>
3716-
<param name="cancellationToken">A cancellation token that should be used to cancel the work</param>
3716+
<param name="cancellationToken">A cancellation token that can be used to cancel the work if it has not yet started. <see cref="M:System.Threading.Tasks.Task.Run``1(System.Func{System.Threading.Tasks.Task{``0}},System.Threading.CancellationToken)" /> does not pass <paramref name="cancellationToken" /> to <paramref name="action" />.</param>
37173717
<summary>Queues the specified work to run on the thread pool and returns a proxy for the <see langword="Task(TResult)" /> returned by <paramref name="function" />.</summary>
37183718
<returns>A <see langword="Task(TResult)" /> that represents a proxy for the <see langword="Task(TResult)" /> returned by <paramref name="function" />.</returns>
37193719
<remarks>
@@ -3774,8 +3774,8 @@ Task t Status: RanToCompletion, Result: 42
37743774
<Docs>
37753775
<typeparam name="TResult">The result type of the task.</typeparam>
37763776
<param name="function">The work to execute asynchronously</param>
3777-
<param name="cancellationToken">A cancellation token that should be used to cancel the work</param>
3778-
<summary>Queues the specified work to run on the thread pool and returns a <see langword="Task(TResult)" /> object that represents that work. A cancellation token allows the work to be cancelled.</summary>
3777+
<param name="cancellationToken">A cancellation token that can be used to cancel the work if it has not yet started. <see cref="M:System.Threading.Tasks.Task.Run``1(System.Func{``0},System.Threading.CancellationToken)" /> does not pass <paramref name="cancellationToken" /> to <paramref name="action" />.</param>
3778+
<summary>Queues the specified work to run on the thread pool and returns a <see langword="Task(TResult)" /> object that represents that work.</summary>
37793779
<returns>A <see langword="Task(TResult)" /> that represents the work queued to execute in the thread pool.</returns>
37803780
<remarks>
37813781
<format type="text/markdown"><![CDATA[

0 commit comments

Comments
 (0)