Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public void EndRead(long which)
 {
     RE.MaybeSwitch();
     _reading.Remove(which);
     RE.Assert(!_writing.Contains(which), $"Write in progress during read at {which}");
 }
Esempio n. 3
0
 public void BeginWrite()
 {
     _writeInProgress = true;
     RE.Assert(_numReaders == 0, $"Write in progress with {_numReaders} readers!");
 }
Esempio n. 4
0
 public void BeginRead()
 {
     _numReaders++;
     RE.Assert(!_writeInProgress, $"Write in progress with {_numReaders} readers!");
 }