private void WriteDocument(DocWriter doc) { System.Diagnostics.Debug.Assert(doc == Enclosing_Instance.skipDocWriter || nextWriteDocID == doc.docID); bool success = false; try { doc.Finish(); nextWriteDocID++; Enclosing_Instance.numDocsInStore++; nextWriteLoc++; System.Diagnostics.Debug.Assert(nextWriteLoc <= waiting.Length); if (nextWriteLoc == waiting.Length) nextWriteLoc = 0; success = true; } finally { if (!success) Enclosing_Instance.SetAborting(); } }