private void FinishCommit()
{
lock (this)
{
if (pendingCommit != null)
{
try
{
if (infoStream != null)
Message("commit: pendingCommit != null");
pendingCommit.FinishCommit(directory);
if (infoStream != null)
Message("commit: wrote segments file \"" + pendingCommit.GetCurrentSegmentFileName() + "\"");
lastCommitChangeCount = pendingCommitChangeCount;
segmentInfos.UpdateGeneration(pendingCommit);
segmentInfos.UserData = pendingCommit.UserData;
SetRollbackSegmentInfos(pendingCommit);
deleter.Checkpoint(pendingCommit, true);
}
finally
{
deleter.DecRef(pendingCommit);
pendingCommit = null;
System.Threading.Monitor.PulseAll(this);
}
}
else if (infoStream != null)
{
Message("commit: pendingCommit == null; skip");
}
if (infoStream != null)
{
Message("commit: done");
}
}
}