/** * Construct and set read point. Write point is uninitialized. */ public MultiVersionConcurrencyControl(long startPoint) { tryAdvanceTo(startPoint, NONE); }
/** * Step the MVCC forward on to a new read/write basis. * @param newStartPoint */ public void advanceTo(long newStartPoint) { while (true) { long seqId = this.getWritePoint(); if (seqId >= newStartPoint) { break; } if (this.tryAdvanceTo(newStartPoint, seqId)) { break; } } }
/** * Construct and set read point. Write point is uninitialized. */ public MultiVersionConcurrencyControl(long startPoint) { tryAdvanceTo(startPoint, NONE); }
/** * Step the MVCC forward on to a new read/write basis. * @param newStartPoint */ public void advanceTo(long newStartPoint) { while (true) { long seqId = this.getWritePoint(); if (seqId >= newStartPoint) break; if (this.tryAdvanceTo(/* newSeqId = */ newStartPoint, /* expected = */ seqId)) break; } }