PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingIConcurrency­Controller
Open sandboxFocus

IConcurrencyController Interface

Controls access to an entity from possibly several threads.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Common.dll
Syntax
[InternalImplement(AttributeId = 627500528741416982L)]
[HasConstraint]
public interface IConcurrencyController
Remarks

An entity, for the sake of this documentation article, is a group of objects that share the same concurrency controller.

Objects that are controlled by a concurrency controller implement the IThreadAware interface.

Properties

Name Description
IsReadOnly

Determines whether the entity is currently read-only.

IsSharable

Determines whether the entity can currently be accessed concurrently by several threads.

ThreadingModel

Gets the ThreadingModel implemented by the current controller.

Methods

Name Description
AcquireAccess(ObjectAccessLevel, ref ConcurrentAccessToken)

Acquires access on the entity for the current thread and waits synchronously if access cannot be immediately acquired.

AcquireAccessAsync(ObjectAccessLevel)

Asynchronously acquires access on the entity for the current thread and returns an async awaiter.

CheckAccess(ObjectAccessLevel)

Determines whether the current thread has a specified level of access to the entity.

RequireAccess(ObjectAccessLevel)

Determines whether the current thread has a specified level of access to the entity and throws an exception if not.