本文整理汇总了C#中Lucene.Net.Index.DocumentsWriter.ResumeAllThreads方法的典型用法代码示例。如果您正苦于以下问题:C# DocumentsWriter.ResumeAllThreads方法的具体用法?C# DocumentsWriter.ResumeAllThreads怎么用?C# DocumentsWriter.ResumeAllThreads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Index.DocumentsWriter
的用法示例。
在下文中一共展示了DocumentsWriter.ResumeAllThreads方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloseInternal
private void CloseInternal(bool waitForMerges)
{
docWriter.PauseAllThreads();
try
{
if (infoStream != null)
Message("now flush at close");
docWriter.Close();
// Only allow a new merge to be triggered if we are
// going to wait for merges:
if (!hitOOM)
{
Flush(waitForMerges, true, true);
}
if (waitForMerges)
// Give merge scheduler last chance to run, in case
// any pending merges are waiting:
mergeScheduler.Merge(this);
mergePolicy.Close();
FinishMerges(waitForMerges);
stopMerges = true;
mergeScheduler.Close();
if (infoStream != null)
Message("now call final commit()");
if (!hitOOM)
{
Commit(0);
}
if (infoStream != null)
Message("at close: " + SegString());
lock (this)
{
readerPool.Close();
docWriter = null;
deleter.Close();
}
if (closeDir)
directory.Close();
if (writeLock != null)
{
writeLock.Release(); // release write lock
writeLock = null;
}
lock (this)
{
closed = true;
}
}
catch (System.OutOfMemoryException oom)
{
HandleOOM(oom, "closeInternal");
}
finally
{
lock (this)
{
closing = false;
System.Threading.Monitor.PulseAll(this);
if (!closed)
{
if (docWriter != null)
docWriter.ResumeAllThreads();
if (infoStream != null)
Message("hit exception while closing");
}
}
}
}