Method | Description | |
---|---|---|
ToTask ( this waitHandle, System.TimeSpan timeout = null, AsyncCallback asyncCallback = null, object state = null ) : IDisposable |
Converts a WaitHandle into a disposable Task Calling dispose on the task before it completes will result in an exception |
public static ToTask ( this waitHandle, System.TimeSpan timeout = null, AsyncCallback asyncCallback = null, object state = null ) : IDisposable |
||
waitHandle | this | the operating-system specfic object to watch |
timeout | System.TimeSpan | optional timeout |
asyncCallback | AsyncCallback | optional callback to call when the waitHandle signals |
state | object | optional state to pass to the callback |
return | IDisposable |