Skip to content

M_CodeJam_Threading_AsyncLock_AcquireAsync_4

Andrew Koryavchenko edited this page Jun 17, 2018 · 1 revision

AsyncLock.AcquireAsync Method (TimeSpan)

Acquires async lock.

Namespace: CodeJam.Threading
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public Task<IDisposable> AcquireAsync(
	TimeSpan timeout
)

VB

Public Function AcquireAsync ( 
	timeout As TimeSpan
) As Task(Of IDisposable)

F#

member AcquireAsync : 
        timeout : TimeSpan -> Task<IDisposable> 

Parameters

 

timeout
Type: System.TimeSpan
A TimeSpan that represents the timeout to wait if lock already acquired, a TimeSpan that represents -1 milliseconds to wait indefinitely, or a TimeSpan that represents 0 milliseconds to return immediately.

Return Value

Type: Task(IDisposable)
A task that returns IDisposable to release the lock.

Exceptions

 

Exception Condition
TimeoutException The timeout has expired.

See Also

Reference

AsyncLock Class
AcquireAsync Overload
CodeJam.Threading Namespace

Clone this wiki locally