示例#1
0
        internal void SubtractFlushedNumDocs(int numFlushed)
        {
            int oldValue = numDocsInRAM;

            while (!numDocsInRAM.CompareAndSet(oldValue, oldValue - numFlushed))
            {
                oldValue = numDocsInRAM;
            }
        }
示例#2
0
 /// <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;
 }
示例#3
0
        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");
        }
示例#4
0
        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.");
        }
示例#5
0
        /// <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);
        }