diff --git a/xml/System.Threading/CancellationTokenSource.xml b/xml/System.Threading/CancellationTokenSource.xml index 1148c15c046..fd047fb2840 100644 --- a/xml/System.Threading/CancellationTokenSource.xml +++ b/xml/System.Threading/CancellationTokenSource.xml @@ -381,13 +381,15 @@ will be notified of the cancellation and will transition to a state where returns true. - - Any callbacks or cancelable operations registered with the will be executed. + The associated is notified of the cancellation and transitions to a state where returns true. + Any callbacks or cancelable operations registered with the are executed, if they haven't already been executed by a previous call to . Subsequent calls to won't execute the same callback again unless reregistered. (Avoid multiple calls to , because the intent of such code is often unclear.) + + Callbacks are executed synchronously in LIFO order. + We recommend that cancelable operations and callbacks registered with not throw exceptions. - This overload of Cancel will aggregate any exceptions thrown into an , such that one callback throwing an exception will not prevent other registered callbacks from being executed. + This overload of Cancel aggregates any exceptions thrown into an , such that one callback throwing an exception will not prevent other registered callbacks from being executed. Calling this method has the same effect as calling [`Cancel(false)`](xref:System.Threading.CancellationTokenSource.Cancel(System.Boolean)). @@ -456,15 +458,17 @@ will be notified of the cancellation and will transition to a state where returns `true`. + The associated is notified of the cancellation and transitions to a state where returns `true`. - Any callbacks or cancelable operations registered with the will be executed. Callbacks will be executed synchronously in LIFO order. + Any callbacks or cancelable operations registered with the are executed, if they haven't already been executed by a previous call to . Subsequent calls to won't execute the same callback again unless reregistered. (Avoid multiple calls to , because the intent of such code is often unclear.) + + Callbacks are executed synchronously in LIFO order. We recommend that cancelable operations and callbacks registered with not throw exceptions. If `throwOnFirstException` is `true`, an exception will immediately propagate out of the call to , preventing the remaining callbacks and cancelable operations from being processed. - If `throwOnFirstException` is `false`, this overload will aggregate any exceptions thrown into an , such that one callback throwing an exception will not prevent other registered callbacks from being executed. + If `throwOnFirstException` is `false`, this overload aggregates any exceptions thrown into an , such that one callback throwing an exception will not prevent other registered callbacks from being executed. ]]> @@ -632,8 +636,8 @@ Communicates a request for cancellation asynchronously. A task that will complete after cancelable operations and callbacks registered with the associated have completed. - The associated will be notified of the cancellation and will synchronously transition to a state where returns . - Any callbacks or cancelable operations registered with the will be executed asynchronously, with the returned representing their eventual completion. + The associated is notified of the cancellation and synchronously transitions to a state where returns . + Any callbacks or cancelable operations registered with the will be executed asynchronously, with the returned representing their eventual completion. Callbacks registered with the token should not throw exceptions. However, any such exceptions that are thrown will be aggregated into an , such that one callback throwing an exception will not prevent other registered callbacks from being executed.