System.ThreadStaticAttribute Class

public sealed class ThreadStaticAttribute: Attribute

Base Types

Object
  Attribute
    ThreadStaticAttribute

Assembly

mscorlib

Library

BCL

Summary

Indicates that there is a unique instance of the designated static field for each thread.

Description

A static field marked with this attribute is not shared between threads. Each executing thread has a separate instance of the field, and independently sets and gets values for that field.

[Note: Do not specify initial values for fields marked with this attribute, because such initialization occurs only once, when the class constructor executes, and therefore affects only one thread. If you do not specify an initial value, you can rely on the field being initialized to its default value if it is a value type, or to null if it is a reference type.

]

Attributes

AttributeUsageAttribute(AttributeTargets.Field, AllowMultiple=false, Inherited=false)

See Also

System Namespace

Members

ThreadStaticAttribute Constructors

ThreadStaticAttribute Constructor


ThreadStaticAttribute Constructor

public ThreadStaticAttribute()

Summary

Constructs and initializes a new instance of the ThreadStaticAttribute class.

See Also

System.ThreadStaticAttribute Class, System Namespace