diff --git a/src/DotNext.Threading/Threading/AsyncAutoResetEvent.cs b/src/DotNext.Threading/Threading/AsyncAutoResetEvent.cs index 89773589f..08d5e89c2 100644 --- a/src/DotNext.Threading/Threading/AsyncAutoResetEvent.cs +++ b/src/DotNext.Threading/Threading/AsyncAutoResetEvent.cs @@ -66,7 +66,7 @@ private void OnCompleted(DefaultWaitNode node) /// /// Indicates whether this event is set. /// - public bool IsSet => Volatile.Read(ref manager.Value); + public bool IsSet => Volatile.Read(in manager.Value); /// /// Sets the state of this event to non signaled, causing consumers to wait asynchronously. diff --git a/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/PersistentState.SessionManagement.cs b/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/PersistentState.SessionManagement.cs index 8af635741..764a90533 100644 --- a/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/PersistentState.SessionManagement.cs +++ b/src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/PersistentState.SessionManagement.cs @@ -31,7 +31,7 @@ private sealed class FastSessionIdPool : SessionIdPool internal override int Take() { int sessionId; - ulong current, newValue = Volatile.Read(ref control); + ulong current, newValue = Volatile.Read(in control); do { sessionId = BitOperations.TrailingZeroCount(current = newValue);