Blocks the current thread until it can enter the
SemaphoreSlim,
using a 32-bit signed integer to measure the time interval,
while observing a
CancellationToken.
Namespace:
System.Threading
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function Wait ( _
millisecondsTimeout As Integer, _
cancellationToken As CancellationToken _
) As Boolean |
Return Value
true if the current thread successfully entered the
SemaphoreSlim; otherwise, false.
Exceptions
Exception | Condition |
---|
System..::.ArgumentOutOfRangeException | millisecondsTimeout is a negative number other than -1,
which represents an infinite time-out. |
System..::.OperationCanceledException | cancellationToken was canceled. |
See Also