AsyncLockTryEnterAsync(Int32) Method

Attempts to obtain exclusive access to the lock.

Definition

Namespace: Gemstone.Threading
Assembly: Gemstone.Threading (in Gemstone.Threading.dll) Version: 1.0.141 -- Release Build+5e2ec463438f5de09767d41cb13e56e90c503d09
public Task<IDisposable> TryEnterAsync(
	int milliseconds
)

Parameters

milliseconds  Int32
The number of milliseconds to wait before failing to take the lock.

Return Value

TaskIDisposable
A task that, if cancelled, indicates the lock was not taken, and must be awaited to obtain the token that will release the lock on Dispose.

Exceptions

TaskCanceledExceptionThe timeout expires before the lock could be taken.

See Also