-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Threading_AsyncLock_AcquireAsync_2
Andrew Koryavchenko edited this page Jun 17, 2018
·
1 revision
Acquires async lock.
Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public Task<IDisposable> AcquireAsync(
int timeout,
CancellationToken cancellation
)
VB
Public Function AcquireAsync (
timeout As Integer,
cancellation As CancellationToken
) As Task(Of IDisposable)
F#
member AcquireAsync :
timeout : int *
cancellation : CancellationToken -> Task<IDisposable>
- timeout
- Type: System.Int32
A number of milliseconds that represents the timeout to wait if lock already acquired, a -1 to wait indefinitely, or a 0 to return immediately. - cancellation
- Type: System.Threading.CancellationToken
The CancellationToken token to observe.
Type: Task(IDisposable)
A task that returns IDisposable to release the lock.
Exception | Condition |
---|---|
OperationCanceledException | The token has had cancellation requested. |
TimeoutException | The timeout has expired. |
AsyncLock Class
AcquireAsync Overload
CodeJam.Threading Namespace