We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd65f6c commit f2a6f0cCopy full SHA for f2a6f0c
src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/StateMachine/WriteAheadLog.Applier.cs
@@ -54,11 +54,12 @@ private async Task ApplyAsync(CancellationToken token)
54
public long LastAppliedIndex
55
{
56
get => Volatile.Read(in appliedIndex);
57
- [MethodImpl(MethodImplOptions.NoInlining)]
+
58
private set
59
60
- appliedIndex = value;
61
- Interlocked.MemoryBarrier();
+ // Full memory barrier to ensure that the index cannot be changed later, somewhere
+ // within Signal due to inlining
62
+ Interlocked.Exchange(ref appliedIndex, value);
63
appliedEvent.Signal(resumeAll: true);
64
}
65
0 commit comments