ThreadLocal(T) Class

Task Parallel System.Threading

Provides thread-local storage of data.

Namespace:  System.Threading
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
<HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True,  _
	ExternalThreading := True)> _
Public Class ThreadLocal(Of T) _
	Implements IDisposable
C#
[HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, 
	ExternalThreading = true)]
public class ThreadLocal<T> : IDisposable

Type Parameters

T
Specifies the type of data stored per-thread.

Remarks

With the exception of Dispose()()(), all public and protected members of ThreadLocal<(Of <(T>)>) are thread-safe and may be used concurrently from multiple threads.

Inheritance Hierarchy

System..::.Object
  System.Threading..::.ThreadLocal<(Of <(T>)>)

See Also