Class WaitHandleExtensions
Provides extension methods for WaitHandle.
Namespace: NanoByte.Common.Threading
Assembly: NanoByte.Common.dll
Syntax
public static class WaitHandleExtensions : Object
Methods
WaitOne(WaitHandle, CancellationToken, Int32)
Waits for the handle to be signalled.
Declaration
public static void WaitOne(this WaitHandle handle, CancellationToken cancellationToken, int millisecondsTimeout = -1)
Parameters
Type | Name | Description |
---|---|---|
WaitHandle | handle | The handle to wait for. |
CancellationToken | cancellationToken | Used to cancel waiting for the handle. |
Int32 | millisecondsTimeout | The number of milliseconds to wait, or -1 to wait indefinitely. |
Remarks
Automatically handles AbandonedMutexException with Warn(String, Exception).
Exceptions
Type | Condition |
---|---|
TimeoutException |
|
System.OperationCanceledException |
|