SSH.NET
SSH.NET copied to clipboard
Optimize (async) token to lazily initialize WaitHandle
Similar to what we do for AsyncResult, we should only initialize the WaitHandle we need to wait for the operation to complete.
We should add a Wait(TimeSpan)
method to Token, and have it implement IDisposable.
When the operation completes synchronously, we can avoid creating the WaitHandle altogether.