public virtual void InitWritableLiveDocs() { UninterruptableMonitor.Enter(this); try { if (Debugging.AssertsEnabled) { Debugging.Assert(UninterruptableMonitor.IsEntered(writer)); Debugging.Assert(Info.Info.DocCount > 0); } //System.out.println("initWritableLivedocs seg=" + info + " liveDocs=" + liveDocs + " shared=" + shared); if (liveDocsShared) { // Copy on write: this means we've cloned a // SegmentReader sharing the current liveDocs // instance; must now make a private clone so we can // change it: LiveDocsFormat liveDocsFormat = Info.Info.Codec.LiveDocsFormat; if (liveDocs == null) { //System.out.println("create BV seg=" + info); liveDocs = liveDocsFormat.NewLiveDocs(Info.Info.DocCount); } else { liveDocs = liveDocsFormat.NewLiveDocs(liveDocs); } liveDocsShared = false; } } finally { UninterruptableMonitor.Exit(this); } }
public virtual void InitWritableLiveDocs() { lock (this) { //Debug.Assert(Thread.holdsLock(Writer)); Debug.Assert(Info.Info.DocCount > 0); //System.out.println("initWritableLivedocs seg=" + info + " liveDocs=" + liveDocs + " shared=" + shared); if (LiveDocsShared) { // Copy on write: this means we've cloned a // SegmentReader sharing the current liveDocs // instance; must now make a private clone so we can // change it: LiveDocsFormat liveDocsFormat = Info.Info.Codec.LiveDocsFormat(); if (LiveDocs_Renamed == null) { //System.out.println("create BV seg=" + info); LiveDocs_Renamed = liveDocsFormat.NewLiveDocs(Info.Info.DocCount); } else { LiveDocs_Renamed = liveDocsFormat.NewLiveDocs(LiveDocs_Renamed); } LiveDocsShared = false; } } }