public virtual void Release(ReadersAndUpdates rld, bool assertInfoLive)
{
lock (this)
{
// Matches incRef in get:
rld.DecRef();
// Pool still holds a ref:
Debug.Assert(rld.RefCount() >= 1);
if (!OuterInstance.PoolReaders && rld.RefCount() == 1)
{
// this is the last ref to this RLD, and we're not
// pooling, so remove it:
// System.out.println("[" + Thread.currentThread().getName() + "] ReaderPool.release: " + rld.info);
if (rld.WriteLiveDocs(OuterInstance.directory))
{
// Make sure we only write del docs for a live segment:
Debug.Assert(assertInfoLive == false || InfoIsLive(rld.Info));
// Must checkpoint because we just
// created new _X_N.del and field updates files;
// don't call IW.checkpoint because that also
// increments SIS.version, which we do not want to
// do here: it was done previously (after we
// invoked BDS.applyDeletes), whereas here all we
// did was move the state to disk:
OuterInstance.CheckpointNoSIS();
}
//System.out.println("IW: done writeLiveDocs for info=" + rld.info);
// System.out.println("[" + Thread.currentThread().getName() + "] ReaderPool.release: drop readers " + rld.info);
rld.DropReaders();
ReaderMap.Remove(rld.Info);
}
}
}