PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingIThread­Aware
Open sandboxFocus

IThreadAware Interface

Interface implemented by objects that are aware of concurrency. Access to thread-aware objects is controlled by a concurrency controller (IConcurrencyController). Any aspect implementing a threading model (ThreadAwareObjectAttribute) introduces this interface to the target class and ensures that accesses to this class go through the controller.

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

Thread-aware does not thread-safe. Check the IsSharable property of ConcurrencyController to check if the current object can be shared between different threads.

Properties

Name Description
ConcurrencyController

Gets the concurrency controller for the current object.

Methods

Name Description
OnParentControllerChanged(IConcurrencyController)

Notifies the object that the effective controller of it's parent has changed.

Extension Methods

ThreadAwareExtensions.AcquireAccess(IThreadAware, ObjectAccessLevel)
ThreadAwareExtensions.AcquireAccess(IThreadAware, ObjectAccessLevel, ref ConcurrentAccessToken)
ThreadAwareExtensions.AcquireAccessAsync(IThreadAware, ObjectAccessLevel)