SemaphoreSlim.Wait Method (Int32)
Blocks the current thread until it can enter the SemaphoreSlim, using a 32-bit signed integer that specifies the timeout.
Assemblies: mscorlib (in mscorlib.dll)
System.Threading (in System.Threading.dll)
millisecondsTimeout is a negative number other than -1, which represents an infinite time-out.
If a thread or task is able to enter the semaphore, it decrements the CurrentCount property by one.
If a thread or task is blocked when calling , and the time-out interval specified by millisecondsTimeout expires, the thread or task doesn’t enter the semaphore, and the CurrentCount property isn’t decremented.