.NET Framework Class Library |
ThreadLocal<(Of <(T>)>)..::.Value Property |
ThreadLocal<(Of <(T>)>) Class See Also Send Feedback |
Gets or sets the value of this instance for the current thread.
Namespace:
System.Threading
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Property Value As T |
C# |
---|
public T Value { get; set; } |
Remarks
If this instance was not previously initialized for the current thread,
accessing Value will attempt to initialize it. If an initialization function was
supplied during the construction, that initialization will happen by invoking the function
to retrieve the initial value for Value. Otherwise, the default value of
T will be used.
Exceptions
Exception | Condition |
---|---|
System..::.InvalidOperationException | The initialization function referenced Value in an improper manner. |
System..::.ObjectDisposedException | The ThreadLocal<(Of <(T>)>) instance has been disposed. |