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

◆ EnsureInitializedCore< T >() [1/3]

static T System.Threading.LazyInitializer.EnsureInitializedCore< T > ( [AllowNull] ref T target,
ref bool initialized,
[NotNull] ref object syncLock,
Func< T > valueFactory )
inlinestaticprivate

Definition at line 79 of file LazyInitializer.cs.

80 {
81 lock (EnsureLockInitialized(ref syncLock))
82 {
83 if (!Volatile.Read(ref initialized))
84 {
85 target = valueFactory();
86 Volatile.Write(ref initialized, value: true);
87 }
88 }
89 return target;
90 }
static object EnsureLockInitialized([NotNull] ref object syncLock)

References System.Threading.LazyInitializer.EnsureLockInitialized(), System.Threading.Volatile.Read(), System.value, and System.Threading.Volatile.Write().