Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicReferenceArray


        $CustomConcurrentHashMap.Strategy localStrategy = $CustomConcurrentHashMap.Impl.this.strategy;
        lock();
        try
        {
          int i = this.count - 1;
          AtomicReferenceArray localAtomicReferenceArray = this.table;
          int j = paramInt & localAtomicReferenceArray.length() - 1;
          Object localObject1 = localAtomicReferenceArray.get(j);
          for (Object localObject2 = localObject1; localObject2 != null; localObject2 = localStrategy.getNext(localObject2))
            if ((localStrategy.getHash(localObject2) == paramInt) && (paramObject.equals(localObject2)))
            {
              this.modCount += 1;
              Object localObject3 = localStrategy.getNext(localObject2);
              for (Object localObject4 = localObject1; localObject4 != localObject2; localObject4 = localStrategy.getNext(localObject4))
              {
                Object localObject5 = localStrategy.getKey(localObject4);
                if (localObject5 != null)
                  localObject3 = localStrategy.copyEntry(localObject5, localObject4, localObject3);
              }
              localAtomicReferenceArray.set(j, localObject3);
              this.count = i;
              boolean bool2 = true;
              return bool2;
            }
          boolean bool1 = false;
View Full Code Here


        if (this.count != 0)
        {
          lock();
          try
          {
            AtomicReferenceArray localAtomicReferenceArray = this.table;
            for (int i = 0; i < localAtomicReferenceArray.length(); i++)
              localAtomicReferenceArray.set(i, null);
            this.modCount += 1;
            this.count = 0;
          }
          finally
          {
View Full Code Here

    {
      long l2 = 0L;
      for (Segment localSegment : arrayOfSegment1)
      {
        int m = localSegment.count;
        AtomicReferenceArray localAtomicReferenceArray = localSegment.table;
        for (int n = 0; n < localAtomicReferenceArray.length(); n++)
          for (ReferenceEntry localReferenceEntry = (ReferenceEntry)localAtomicReferenceArray.get(n); localReferenceEntry != null; localReferenceEntry = localReferenceEntry.getNext())
          {
            Object localObject = localSegment.getLiveValue(localReferenceEntry);
            if ((localObject != null) && (this.valueEquivalence.equivalent(paramObject, localObject)))
              return true;
          }
View Full Code Here

      this.accessQueue = (paramLocalCache.usesAccessQueue() ? new LocalCache.AccessQueue() : LocalCache.discardingQueue());
    }

    AtomicReferenceArray newEntryArray(int paramInt)
    {
      return new AtomicReferenceArray(paramInt);
    }
View Full Code Here

      try
      {
        long l = this.map.ticker.read();
        preWriteCleanup(l);
        int j = this.count - 1;
        AtomicReferenceArray localAtomicReferenceArray = this.table;
        int k = paramInt & localAtomicReferenceArray.length() - 1;
        LocalCache.ReferenceEntry localReferenceEntry2 = (LocalCache.ReferenceEntry)localAtomicReferenceArray.get(k);
        for (localReferenceEntry1 = localReferenceEntry2; localReferenceEntry1 != null; localReferenceEntry1 = localReferenceEntry1.getNext())
        {
          Object localObject2 = localReferenceEntry1.getKey();
          if ((localReferenceEntry1.getHash() == paramInt) && (localObject2 != null) && (this.map.keyEquivalence.equivalent(paramObject, localObject2)))
          {
            localValueReference = localReferenceEntry1.getValueReference();
            if (localValueReference.isLoading())
            {
              i = 0;
              break;
            }
            Object localObject3 = localValueReference.get();
            if (localObject3 == null)
            {
              enqueueNotification(localObject2, paramInt, localValueReference, RemovalCause.COLLECTED);
            }
            else if (this.map.isExpired(localReferenceEntry1, l))
            {
              enqueueNotification(localObject2, paramInt, localValueReference, RemovalCause.EXPIRED);
            }
            else
            {
              recordLockedRead(localReferenceEntry1, l);
              this.statsCounter.recordHits(1);
              Object localObject4 = localObject3;
              return localObject4;
            }
            this.writeQueue.remove(localReferenceEntry1);
            this.accessQueue.remove(localReferenceEntry1);
            this.count = j;
            break;
          }
        }
        if (i != 0)
        {
          localLoadingValueReference = new LocalCache.LoadingValueReference();
          if (localReferenceEntry1 == null)
          {
            localReferenceEntry1 = newEntry(paramObject, paramInt, localReferenceEntry2);
            localReferenceEntry1.setValueReference(localLoadingValueReference);
            localAtomicReferenceArray.set(k, localReferenceEntry1);
          }
          else
          {
            localReferenceEntry1.setValueReference(localLoadingValueReference);
          }
View Full Code Here

      lock();
      try
      {
        long l = this.map.ticker.read();
        preWriteCleanup(l);
        AtomicReferenceArray localAtomicReferenceArray = this.table;
        int i = paramInt & localAtomicReferenceArray.length() - 1;
        LocalCache.ReferenceEntry localReferenceEntry = (LocalCache.ReferenceEntry)localAtomicReferenceArray.get(i);
        for (localObject1 = localReferenceEntry; localObject1 != null; localObject1 = ((LocalCache.ReferenceEntry)localObject1).getNext())
        {
          localObject2 = ((LocalCache.ReferenceEntry)localObject1).getKey();
          if ((((LocalCache.ReferenceEntry)localObject1).getHash() == paramInt) && (localObject2 != null) && (this.map.keyEquivalence.equivalent(paramObject, localObject2)))
          {
            localObject3 = ((LocalCache.ReferenceEntry)localObject1).getValueReference();
            if (((LocalCache.ValueReference)localObject3).isLoading())
            {
              localLoadingValueReference1 = null;
              return localLoadingValueReference1;
            }
            this.modCount += 1;
            LocalCache.LoadingValueReference localLoadingValueReference1 = new LocalCache.LoadingValueReference((LocalCache.ValueReference)localObject3);
            ((LocalCache.ReferenceEntry)localObject1).setValueReference(localLoadingValueReference1);
            LocalCache.LoadingValueReference localLoadingValueReference2 = localLoadingValueReference1;
            return localLoadingValueReference2;
          }
        }
        this.modCount += 1;
        Object localObject2 = new LocalCache.LoadingValueReference();
        localObject1 = newEntry(paramObject, paramInt, localReferenceEntry);
        ((LocalCache.ReferenceEntry)localObject1).setValueReference((LocalCache.ValueReference)localObject2);
        localAtomicReferenceArray.set(i, localObject1);
        Object localObject3 = localObject2;
        return localObject3;
      }
      finally
      {
View Full Code Here

      throw new AssertionError();
    }

    LocalCache.ReferenceEntry getFirst(int paramInt)
    {
      AtomicReferenceArray localAtomicReferenceArray = this.table;
      return (LocalCache.ReferenceEntry)localAtomicReferenceArray.get(paramInt & localAtomicReferenceArray.length() - 1);
    }
View Full Code Here

      try
      {
        if (this.count != 0)
        {
          long l = this.map.ticker.read();
          AtomicReferenceArray localAtomicReferenceArray = this.table;
          int i = localAtomicReferenceArray.length();
          for (int j = 0; j < i; j++)
            for (LocalCache.ReferenceEntry localReferenceEntry = (LocalCache.ReferenceEntry)localAtomicReferenceArray.get(j); localReferenceEntry != null; localReferenceEntry = localReferenceEntry.getNext())
            {
              Object localObject1 = getLiveValue(localReferenceEntry, l);
              if ((localObject1 != null) && (this.map.valueEquivalence.equivalent(paramObject, localObject1)))
              {
                boolean bool2 = true;
View Full Code Here

        if (i > this.threshold)
        {
          expand();
          i = this.count + 1;
        }
        AtomicReferenceArray localAtomicReferenceArray = this.table;
        int j = paramInt & localAtomicReferenceArray.length() - 1;
        LocalCache.ReferenceEntry localReferenceEntry1 = (LocalCache.ReferenceEntry)localAtomicReferenceArray.get(j);
        for (LocalCache.ReferenceEntry localReferenceEntry2 = localReferenceEntry1; localReferenceEntry2 != null; localReferenceEntry2 = localReferenceEntry2.getNext())
        {
          localObject1 = localReferenceEntry2.getKey();
          if ((localReferenceEntry2.getHash() == paramInt) && (localObject1 != null) && (this.map.keyEquivalence.equivalent(paramObject1, localObject1)))
          {
            LocalCache.ValueReference localValueReference = localReferenceEntry2.getValueReference();
            Object localObject2 = localValueReference.get();
            if (localObject2 == null)
            {
              this.modCount += 1;
              if (localValueReference.isActive())
              {
                enqueueNotification(paramObject1, paramInt, localValueReference, RemovalCause.COLLECTED);
                setValue(localReferenceEntry2, paramObject1, paramObject2, l);
                i = this.count;
              }
              else
              {
                setValue(localReferenceEntry2, paramObject1, paramObject2, l);
                i = this.count + 1;
              }
              this.count = i;
              evictEntries();
              localObject3 = null;
              return localObject3;
            }
            if (paramBoolean)
            {
              recordLockedRead(localReferenceEntry2, l);
              localObject3 = localObject2;
              return localObject3;
            }
            this.modCount += 1;
            enqueueNotification(paramObject1, paramInt, localValueReference, RemovalCause.REPLACED);
            setValue(localReferenceEntry2, paramObject1, paramObject2, l);
            evictEntries();
            Object localObject3 = localObject2;
            return localObject3;
          }
        }
        this.modCount += 1;
        localReferenceEntry2 = newEntry(paramObject1, paramInt, localReferenceEntry1);
        setValue(localReferenceEntry2, paramObject1, paramObject2, l);
        localAtomicReferenceArray.set(j, localReferenceEntry2);
        i = this.count + 1;
        this.count = i;
        evictEntries();
        Object localObject1 = null;
        return localObject1;
View Full Code Here

      }
    }

    void expand()
    {
      AtomicReferenceArray localAtomicReferenceArray1 = this.table;
      int i = localAtomicReferenceArray1.length();
      if (i >= 1073741824)
        return;
      int j = this.count;
      AtomicReferenceArray localAtomicReferenceArray2 = newEntryArray(i << 1);
      this.threshold = (localAtomicReferenceArray2.length() * 3 / 4);
      int k = localAtomicReferenceArray2.length() - 1;
      for (int m = 0; m < i; m++)
      {
        LocalCache.ReferenceEntry localReferenceEntry1 = (LocalCache.ReferenceEntry)localAtomicReferenceArray1.get(m);
        if (localReferenceEntry1 != null)
        {
          LocalCache.ReferenceEntry localReferenceEntry2 = localReferenceEntry1.getNext();
          int n = localReferenceEntry1.getHash() & k;
          if (localReferenceEntry2 == null)
          {
            localAtomicReferenceArray2.set(n, localReferenceEntry1);
          }
          else
          {
            Object localObject = localReferenceEntry1;
            int i1 = n;
            int i2;
            for (LocalCache.ReferenceEntry localReferenceEntry3 = localReferenceEntry2; localReferenceEntry3 != null; localReferenceEntry3 = localReferenceEntry3.getNext())
            {
              i2 = localReferenceEntry3.getHash() & k;
              if (i2 != i1)
              {
                i1 = i2;
                localObject = localReferenceEntry3;
              }
            }
            localAtomicReferenceArray2.set(i1, localObject);
            for (localReferenceEntry3 = localReferenceEntry1; localReferenceEntry3 != localObject; localReferenceEntry3 = localReferenceEntry3.getNext())
            {
              i2 = localReferenceEntry3.getHash() & k;
              LocalCache.ReferenceEntry localReferenceEntry4 = (LocalCache.ReferenceEntry)localAtomicReferenceArray2.get(i2);
              LocalCache.ReferenceEntry localReferenceEntry5 = copyEntry(localReferenceEntry3, localReferenceEntry4);
              if (localReferenceEntry5 != null)
              {
                localAtomicReferenceArray2.set(i2, localReferenceEntry5);
              }
              else
              {
                removeCollectedEntry(localReferenceEntry3);
                j--;
View Full Code Here

TOP

Related Classes of java.util.concurrent.atomic.AtomicReferenceArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.