ThreadLocal(T) Constructor (Func(T), Boolean)
Collapse the table of content
Expand the table of content

ThreadLocal(Of T) Constructor (Func(Of T), Boolean)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Initializes the ThreadLocal(Of T) instance with the specified valueFactory function.

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

'Declaration
Public Sub New ( _
	valueFactory As Func(Of T), _
	trackAllValues As Boolean _
)

Parameters

valueFactory
Type: System.Func(Of T)
The Func(Of TResult) invoked to produce a lazily-initialized value when an attempt is made to retrieve Value without it having been previously initialized.
trackAllValues
Type: System.Boolean
Whether to track all values set on the instance and expose them via the Values property.

ExceptionCondition
ArgumentNullException

valueFactory is a Nothing reference (Nothing in Visual Basic).

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft