Custom attribute that, when applied on a type, ensures that only one thread executes in methods of this type. When more than one thread accesses methods of this type, a ConcurrentAccessException exception is thrown.
Inheritance
ThreadUnsafeAttribute
Implements
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
[Metric("UsedFeatures", "PostSharp.Patterns.Threading.ThreadUnsafe")]
[Serializer(typeof(ThreadUnsafeAttribute.Serializer))]
public sealed class ThreadUnsafeAttribute : ThreadAwareAttribute, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspectProvider, IService, IAdviceProvider, IAspect, IThreadAware, IQueryInterface
Constructors
Name | Description |
---|---|
ThreadUnsafeAttribute() | Initializes a new ThreadUnsafeAttribute. policy. |
ThreadUnsafeAttribute(PortableFormatterConstructorContext) |