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: 2023.0.3.0 (2023.0.3.0)
C#
bool Acquire( TimeSpan timeout, CancellationToken cancellationToken )
Parameters
- timeout
- Type: System.TimeSpan
Timeout. - cancellationToken
- Type: System.Threading.CancellationToken
A CancellationToken.
Return Value
Type: Booleantrue if the lock was acquired, or false if the operation has timed out before the lock could be acquired.