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

◆ PublicationOnly()

void System.Lazy< T, TMetadata >.PublicationOnly ( LazyHelper publicationOnly,
T possibleValue )
inlineprivate

Definition at line 142 of file Lazy.cs.

143 {
144 LazyHelper lazyHelper = Interlocked.CompareExchange(ref _state, LazyHelper.PublicationOnlyWaitForOtherThreadToPublish, publicationOnly);
145 if (lazyHelper == publicationOnly)
146 {
147 _factory = null;
148 _value = possibleValue;
149 _state = null;
150 }
151 }
static readonly LazyHelper PublicationOnlyWaitForOtherThreadToPublish
Definition LazyHelper.cs:17
volatile LazyHelper _state
Definition Lazy.cs:11
T _value
Definition Lazy.cs:15
Func< T > _factory
Definition Lazy.cs:13
static int CompareExchange(ref int location1, int value, int comparand)

References System.Lazy< T, TMetadata >._factory, System.Lazy< T, TMetadata >._state, System.Lazy< T, TMetadata >._value, System.Threading.Interlocked.CompareExchange(), and System.LazyHelper.PublicationOnlyWaitForOtherThreadToPublish.