NanoByte.Common  2.8.1
NanoByte.Common.Threading.WaitHandleExtensions Class Reference

Provides extension methods for System.Threading.WaitHandle. More...

Static Public Member Functions

static void WaitOne (this WaitHandle handle, CancellationToken cancellationToken, int millisecondsTimeout=-1)
 Waits for the handle to be signalled. More...
 

Detailed Description

Provides extension methods for System.Threading.WaitHandle.

Member Function Documentation

◆ WaitOne()

static void NanoByte.Common.Threading.WaitHandleExtensions.WaitOne ( this WaitHandle  handle,
CancellationToken  cancellationToken,
int  millisecondsTimeout = -1 
)
inlinestatic

Waits for the handle to be signalled.

Parameters
handleThe handle to wait for.
millisecondsTimeoutThe number of milliseconds to wait, or -1 to wait indefinitely.
cancellationTokenUsed to cancel waiting for the handle.
Exceptions
TimeoutExceptionmillisecondsTimeout elapsed without the handle being signalled.
OperationCanceledExceptioncancellationToken was signaled while waiting for the handle.

Automatically handles System.Threading.AbandonedMutexException with Log.Warn(Exception).


The documentation for this class was generated from the following file: