SSH.NET icon indicating copy to clipboard operation
SSH.NET copied to clipboard

Optimize (async) token to lazily initialize WaitHandle

Open drieseng opened this issue 4 years ago • 0 comments

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.

drieseng avatar Apr 26 '20 13:04 drieseng