public bool OnEvent(ValueEvent @event, long sequence, bool endOfBatch) { value.WriteCompilerOnlyFence(value.ReadCompilerOnlyFence() + @event.Value); if (count == sequence) { latch.Signal(); } return(true); }
public void rset(CountdownEvent latch, long expectedCount) { _fizzBuzzCounter.WriteCompilerOnlyFence(0L); _ce = latch; _iterations = expectedCount; }
public void rset(ManualResetEvent latch, long expectedCount) { _fizzBuzzCounter.WriteCompilerOnlyFence(0L); this._mru = latch; _iterations = expectedCount; }
/// <summary> /// Construct a new sequence counter that can be tracked across threads. /// </summary> /// <param name="initialValue">initial value for the counter</param> public Sequence(long initialValue) { _value.WriteCompilerOnlyFence(initialValue); }
public void reset(CountdownEvent latch, long expectedCount) { _stepThreeCounter.WriteCompilerOnlyFence(0L); this.latch = latch; _iterations = expectedCount; }
public void WriteCompilerOnlyFenceChangesInitialValue() { _volatile.WriteCompilerOnlyFence(NewValue); Assert.AreEqual(NewValue, _volatile.ReadUnfenced()); }