sportdog

导航

 

 

  public class CounterNoLock:CountBase
    {
        private int _count;
        public int Count
        {
            get
            {
                return _count;
            }
        }
        public override void Increment()
        {
            Interlocked.Increment(ref _count);
        }

        public override void Decreament()
        {
            Interlocked.Decrement(ref _count);
        }
    }

 

posted on 2018-08-20 14:12  sportdog  阅读(106)  评论(0编辑  收藏  举报