public void Test1() { JT808AtomicCounter jT808AtomicCounter = new JT808AtomicCounter(); JT808AtomicCounter jT808AtomicCounter1 = new JT808AtomicCounter(); Parallel.For(0, 1000, (i) => { jT808AtomicCounter.Increment(); }); Assert.Equal(1000, jT808AtomicCounter.Count); Parallel.For(0, 1000, (i) => { jT808AtomicCounter1.Increment(); }); Assert.Equal(1000, jT808AtomicCounter1.Count); }
public JT808SendAtomicCounterService() { MsgSuccessCounter = new JT808AtomicCounter(); }
public JT808ClientReceiveAtomicCounterService() { MsgSuccessCounter = new JT808AtomicCounter(); }
public JT808TrafficService() { receiveCounter = new JT808AtomicCounter(); sendCounter = new JT808AtomicCounter(); }
public JT808AtomicCounterService() { MsgSuccessCounter = new JT808AtomicCounter(); MsgFailCounter = new JT808AtomicCounter(); }