Open sandboxFocus

Class RequiresThreadSafeAttribute

Custom attribute that, when applied to a field, property or parameter, checks that the assigned object is thread safe. Otherwise, the assignment results in an ArgumentException/

Inheritance
RequiresThreadSafeAttribute
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
[MulticastAttributeUsage(MulticastTargets.Field|MulticastTargets.Property|MulticastTargets.Parameter, Inheritance = MulticastInheritance.Strict)]
[Serializer(typeof(RequiresThreadSafeAttribute.Serializer))]
public sealed class RequiresThreadSafeAttribute : LocationLevelAspect, ILocationLevelAspect, ILocationLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ILocationValidationAspect<object>, ILocationValidationAspect, IAspect

Constructors

Name Description
RequiresThreadSafeAttribute()
RequiresThreadSafeAttribute(PortableFormatterConstructorContext)

Methods

Name Description
RuntimeInitialize(LocationInfo)

Initializes the current aspect.