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.147 -- Release Build+71918e29738e2d0700de8aec0ad72324b16f1428
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