JoinableTask.JoinAsync(CancellationToken) Method

Definition

Shares any access to the main thread the caller may have Joins any main thread affinity of the caller with the asynchronous operation to avoid deadlocks in the event that the main thread ultimately synchronously blocks waiting for the operation to complete.

public System.Threading.Tasks.Task JoinAsync (System.Threading.CancellationToken cancellationToken = default);
member this.JoinAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function JoinAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

A cancellation token that will revert the Join and cause the returned task to complete before the async operation has completed.

Returns

A task that completes after the asynchronous operation completes and the join is reverted.

Applies to