共用方式為


JoinableTask.Join(CancellationToken) Method

Definition

Synchronously blocks the calling thread until the operation has completed. If the caller is on the Main thread (or is executing within a JoinableTask that has access to the main thread) the caller's access to the Main thread propagates to this JoinableTask so that it may also access the main thread.

public void Join (System.Threading.CancellationToken cancellationToken = default);
member this.Join : System.Threading.CancellationToken -> unit
Public Sub Join (Optional cancellationToken As CancellationToken = Nothing)

Parameters

cancellationToken
CancellationToken

A cancellation token that will exit this method before the task is completed.

Exceptions

Thrown when cancellationToken is canceled.

Remarks

Any exception thrown by the asynchronous operation is propagated out to the caller of this method.

Applies to