diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Trace.cs b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Trace.cs index d8625f32fcfc4e..3a129ec2b04cd3 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Trace.cs +++ b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Trace.cs @@ -20,9 +20,7 @@ private Trace() } public static CorrelationManager CorrelationManager => - Volatile.Read(ref field) ?? - Interlocked.CompareExchange(ref field, new(), null) ?? - field; + field ?? Interlocked.CompareExchange(ref field, new(), null) ?? field; /// /// Gets the collection of listeners that is monitoring the trace output. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs index 12d107a8459f63..e9be1f3d76ba7e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs @@ -472,9 +472,7 @@ internal TResult GetResultCore(bool waitCompletionNotification) /// the default constructor on the factory type. /// public static new TaskFactory Factory => - Volatile.Read(ref field) ?? - Interlocked.CompareExchange(ref field, new(), null) ?? - field; + field ?? Interlocked.CompareExchange(ref field, new(), null) ?? field; /// /// Evaluates the value selector of the Task which is passed in as an object and stores the result.