PostSharpAPI ReferencePost­Sharp.​Patterns.​Caching.​LockingILock­HandleAcquire
Open sandboxFocus

ILockHandle.Acquire Method

Acquire(TimeSpan, CancellationToken)

Synchronously acquires the lock bound to the current handle.

Declaration
bool Acquire(TimeSpan timeout, CancellationToken cancellationToken)
Parameters
Type Name Description
System.TimeSpan timeout

Timeout.

CancellationToken cancellationToken

A CancellationToken.

Returns
Type Description
Boolean

true if the lock was acquired, or false if the operation has timed out before the lock could be acquired.