Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ViaFactory()

void System.Lazy< T, TMetadata >.ViaFactory ( LazyThreadSafetyMode mode)
inlineprivate

Definition at line 104 of file Lazy.cs.

105 {
106 try
107 {
108 Func<T> factory = _factory;
109 if (factory == null)
110 {
111 throw new InvalidOperationException(SR.Lazy_Value_RecursiveCallsToValue);
112 }
113 _factory = null;
114 _value = factory();
115 _state = null;
116 }
117 catch (Exception exception)
118 {
119 _state = new LazyHelper(mode, exception);
120 throw;
121 }
122 }
volatile LazyHelper _state
Definition Lazy.cs:11
T _value
Definition Lazy.cs:15
Func< T > _factory
Definition Lazy.cs:13

References System.Lazy< T, TMetadata >._factory, System.Lazy< T, TMetadata >._state, System.Lazy< T, TMetadata >._value, System.exception, and System.SR.Lazy_Value_RecursiveCallsToValue.

Referenced by System.Lazy< T, TMetadata >.CreateValue(), and System.Lazy< T, TMetadata >.ExecutionAndPublication().