Asynchronously waits to enter the System.Threading.SemaphoreSlim, using a TimeSpan to measure the time interval, while observing a System.Threading.CancellationToken.
- timeout
- A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.
- cancellationToken
- The System.Threading.CancellationToken token to observe.
A task that will complete with a result of true if the current thread successfully entered the System.Threading.SemaphoreSlim, otherwise with a result of false.