System.Threading.LazyThreadSafetyMode.None Field

The Lazy`1 instance is not thread safe; if the instance is accessed from multiple threads, its behavior is undefined. Use this mode only when high performance is crucial and the Lazy`1 instance is guaranteed never to be initialized from more than one thread. If you use a Lazy`1 constructor that specifies an initialization method (valueFactory parameter), and if that initialization method throws an exception (or fails to handle an exception) the first time you call the Lazy`1.Value property, then the exception is cached and thrown again on subsequent calls to the Lazy`1.Value property. If you use a Lazy`1 constructor that does not specify an initialization method, exceptions that are thrown by the default constructor for T are not cached. In that case, a subsequent call to the Lazy`1.Value property might successfully initialize the Lazy`1 instance. If the initialization method recursively accesses the Lazy`1.Value property of the Lazy`1 instance, an InvalidOperationException is thrown.

Syntax

LazyThreadSafetyMode None

Requirements

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