Open sandboxFocus

Class UpgradeableReaderAttribute

Custom attribute that, when applied to a method, specifies that the method requires read and write access to the object, but other threads are allowed to acquire read (but not write) access to the object until a method with the WriterAttribute custom attribute is executed.

Inheritance
UpgradeableReaderAttribute
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Instance, AllowMultiple = false)]
public class UpgradeableReaderAttribute : AccessLevelAttribute, IValidableAnnotation
Remarks

Use this attribute on long-running methods that perform many reads followed by a few writes. The method can then call a method annotated with WriterAttribute to perform the writes, and the object cannot be modified by other threads in the meantime.

Constructors

Name Description
UpgradeableReaderAttribute()

See Also