ILockHandle.AcquireAsync Method |
Asynchronously 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#
Task<bool> AcquireAsync( TimeSpan timeout, CancellationToken cancellationToken )
Parameters
- timeout
- Type: System.TimeSpan
Timeout. - cancellationToken
- Type: System.Threading.CancellationToken
A CancellationToken.
Return Value
Type: Task<Boolean>true if the lock was acquired, or false if the operation has timed out before the lock could be acquired.