WaitHandleExtensionsWaitOneAsync(WaitHandle, CancellationToken) Method

Waits for a signal asynchronously on the provided handle.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static Task<bool> WaitOneAsync(
	this WaitHandle handle,
	CancellationToken cancellationToken
)

Parameters

handle  WaitHandle
The handle to wait on.
cancellationToken  CancellationToken
A token for cancellation.

Return Value

TaskBoolean
, if the specified handle receives a signal before canceling; otherwise, .

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type WaitHandle. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also