public void BeginWrite(long which) { RE.MaybeSwitch(); RE.Assert(!_reading.Contains(which), $"Read in progress during write at {which}"); RE.Assert(!_writing.Contains(which), $"Write in progress during write at {which}"); _writing.Add(which); }
public void EndRead(long which) { RE.MaybeSwitch(); _reading.Remove(which); RE.Assert(!_writing.Contains(which), $"Write in progress during read at {which}"); }
public void BeginWrite() { _writeInProgress = true; RE.Assert(_numReaders == 0, $"Write in progress with {_numReaders} readers!"); }
public void BeginRead() { _numReaders++; RE.Assert(!_writeInProgress, $"Write in progress with {_numReaders} readers!"); }