PostSharp6.5//API Reference/Post­Sharp.​Patterns.​Caching.​Locking Namespace/ILock­Handle Interface/ILock­Handle Methods/ILock­Handle.​Acquire Method

ILockHandle.Acquire Method

Synchronously acquires the lock bound to the current handle.

Namespace:  PostSharp.Patterns.Caching.Locking
Assembly:  PostSharp.Patterns.Caching (in PostSharp.Patterns.Caching.dll) Version: 6.5.13.0 (6.5.13.0)
Syntax
C#
bool Acquire(
	TimeSpan timeout,
	CancellationToken cancellationToken
)

Parameters

timeout
Type: System.TimeSpan
Timeout.
cancellationToken
Type: System.Threading.CancellationToken
A CancellationToken.

Return Value

Type: Boolean
true if the lock was acquired, or false if the operation has timed out before the lock could be acquired.
See Also