internal void SubtractFlushedNumDocs(int numFlushed) { int oldValue = numDocsInRAM; while (!numDocsInRAM.CompareAndSet(oldValue, oldValue - numFlushed)) { oldValue = numDocsInRAM; } }
/// <summary> /// Expert: increments the refCount of this TaxonomyReader /// instance only if it has not been closed yet. Returns /// <c>true</c> on success. /// </summary> public bool TryIncRef() { int count; while ((count = refCount) > 0) { if (refCount.CompareAndSet(count, count + 1)) { return true; } } return false; }
internal void IncRef() { int count; while ((count = @ref) > 0) { if (@ref.CompareAndSet(count, count + 1)) { return; } } throw new ObjectDisposedException(this.GetType().FullName, "SegmentCoreReaders is already closed"); }
internal void IncRef() { int count; while ((count = @ref) > 0) { if (@ref.CompareAndSet(count, count + 1)) { return; } } throw AlreadyClosedException.Create(this.GetType().FullName, "SegmentCoreReaders is already disposed."); }
/// <summary> /// Expert: increments the refCount of this TaxonomyReader /// instance only if it has not been closed yet. Returns /// <c>true</c> on success. /// </summary> public bool TryIncRef() { int count; while ((count = refCount.Get()) > 0) { if (refCount.CompareAndSet(count, count + 1)) { return(true); } } return(false); }