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}"); }