Open sandboxFocus

Interface ILockManager

Provides instances of named locks.

Namespace: PostSharp.Patterns.Caching.Locking
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public interface ILockManager
Remarks

Two implementations are provided: NullLockManager and LocalLockManager. To change the lock manager, set the LockManager property.

The caching aspect requests a lock named after the cache key when a cached method is not found in the cache, so that only one caller evaluates the method for a given set of arguments. To prevent concurrent evaluation across processes or machines, implement this interface and ILockHandle on top of a distributed lock.

Methods

Name Description
GetLock(string)

Gets a handle to a named lock. This method must return immediately. Waiting, if any, must be done in the Acquire(TimeSpan, CancellationToken) method.

See Also