asp.net.ph

ThreadStaticAttribute Class

System Namespace


Indicates that the value of a static field is unique for each thread.

ThreadStaticAttribute Class Members

Collapse   Constructors

Visibility Constructor Parameters
public ThreadStaticAttribute ( )

Remarks

A static field marked with ThreadStaticAttribute is not shared between threads. Each executing thread has a separate instance of the static field, and independently sets and gets values for that field. If the static field is accessed on a different thread, it will contain a different value.

Use this attribute as it is, and do not derive from it. The following is an example of ThreadStaticAttribute syntax:

            [ ThreadStatic ]
            static int value = 3;
         

For more information about using attributes, see Extending Metadata Using Attributes.

See Also

Attribute   Thread | Threading Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note