Exemple #1
0
            private int GetReaderIndex()
            {
                if (_thisReaderIndex.IsValueCreated)
                {
                    return(_thisReaderIndex.Value);
                }
                var result = RInterlocked.Increment(ref _nextReaderIndex) - 1;

                _thisReaderIndex.Value = result;
                return(result);
            }
Exemple #2
0
 public void Arrive()
 {
     RInterlocked.Increment(ref _numReaders);
 }
Exemple #3
0
            public void Arrive()
            {
                int index = GetIndex();

                RInterlocked.Increment(ref _occupancyCounts[index]);
            }