private int GetReaderIndex() { if (_thisReaderIndex.IsValueCreated) { return(_thisReaderIndex.Value); } var result = RInterlocked.Increment(ref _nextReaderIndex) - 1; _thisReaderIndex.Value = result; return(result); }
public void Arrive() { RInterlocked.Increment(ref _numReaders); }
public void Arrive() { int index = GetIndex(); RInterlocked.Increment(ref _occupancyCounts[index]); }