6 writes to _state
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (6)
305
_state
= LazyHelper.Create(mode, useDefaultConstructor);
311
_state
= null; // volatile write, must occur after setting _value
322
_state
= null; // volatile write, must occur after setting _value
326
_state
= new LazyHelper(mode, exception);
353
LazyHelper? previous = Interlocked.CompareExchange(ref
_state
, LazyHelper.PublicationOnlyWaitForOtherThreadToPublish, publicationOnly);
358
_state
= null; // volatile write, must occur after setting _value
7 references to _state
System.Private.CoreLib (7)
src\libraries\System.Private.CoreLib\src\System\Lazy.cs (7)
337
if (ReferenceEquals(
_state
, executionAndPublication))
383
while (
_state
is not null)
395
LazyHelper? state =
_state
;
465
internal LazyThreadSafetyMode? Mode => LazyHelper.GetMode(
_state
);
470
internal bool IsValueFaulted => LazyHelper.GetIsValueFaulted(
_state
);
481
public bool IsValueCreated =>
_state
== null;
505
public T Value =>
_state
== null ? _value! : CreateValue();