Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for compareAndSet (0.23 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

          for (double x : VALUES) {
            assertBitEquals(prev, aa.get(i));
            assertFalse(aa.compareAndSet(i, unused, x));
            assertBitEquals(prev, aa.get(i));
            assertTrue(aa.compareAndSet(i, prev, x));
            assertBitEquals(x, aa.get(i));
            prev = x;
          }
        }
      }
    
      /** compareAndSet in one thread enables another waiting for value to succeed */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 10K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

          for (double x : VALUES) {
            assertBitEquals(prev, aa.get(i));
            assertFalse(aa.compareAndSet(i, unused, x));
            assertBitEquals(prev, aa.get(i));
            assertTrue(aa.compareAndSet(i, prev, x));
            assertBitEquals(x, aa.get(i));
            prev = x;
          }
        }
      }
    
      /** compareAndSet in one thread enables another waiting for value to succeed */
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 14.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java

       * AtomicInteger's atomic operations, with some help from ConcurrentMap's atomic operations on
       * creation and removal (including automatic removal of zeroes). If the modification of an
       * AtomicInteger results in zero, we compareAndSet the value to zero; if that succeeds, we remove
       * the entry from the Map. If another operation sees a zero in the map, it knows that the entry is
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/InterruptibleTask.java

         * interrupt, yet it will still run, since interruptTask will leave the runner value null,
         * allowing the CAS below to succeed.
         */
        Thread currentThread = Thread.currentThread();
        if (!compareAndSet(null, currentThread)) {
          return; // someone else has run or is running.
        }
    
        boolean run = !isDone();
        T result = null;
        Throwable error = null;
        try {
          if (run) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Sep 29 21:34:48 GMT 2023
    - 9.9K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java

          assertBitEquals(x, at.doubleValue());
        }
      }
    
      /** compareAndSet treats +0.0 and -0.0 as distinct values */
      public void testDistinctZeros() {
        AtomicDouble at = new AtomicDouble(+0.0);
        assertFalse(at.compareAndSet(-0.0, 7.0));
        assertFalse(at.weakCompareAndSet(-0.0, 7.0));
        assertBitEquals(+0.0, at.get());
        assertTrue(at.compareAndSet(+0.0, -0.0));
        assertBitEquals(-0.0, at.get());
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 10.2K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/ConcurrentHashMultiset.java

       * AtomicInteger's atomic operations, with some help from ConcurrentMap's atomic operations on
       * creation and removal (including automatic removal of zeroes). If the modification of an
       * AtomicInteger results in zero, we compareAndSet the value to zero; if that succeeds, we remove
       * the entry from the Map. If another operation sees a zero in the map, it knows that the entry is
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/AtomicLongMap.java

            if (oldValue == 0L) {
              // don't compareAndSet a zero
              if (map.replace(key, atomic, new AtomicLong(delta))) {
                return delta;
              }
              // atomic replaced
              continue outer;
            }
    
            long newValue = oldValue + delta;
            if (atomic.compareAndSet(oldValue, newValue)) {
              return newValue;
            }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/hash/BloomFilterStrategies.java

          long newValue;
          do {
            oldValue = data.get(longIndex);
            newValue = oldValue | mask;
            if (oldValue == newValue) {
              return false;
            }
          } while (!data.compareAndSet(longIndex, oldValue, newValue));
    
          // We turned the bit on, so increment bitCount.
          bitCount.increment();
          return true;
        }
    
        boolean get(long bitIndex) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 10.7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/util/concurrent/ExecutionSequencer.java

            executingTaskQueue.thread = null;
          }
        }
    
        private boolean trySetStarted() {
          return compareAndSet(NOT_RUN, STARTED);
        }
    
        private boolean trySetCancelled() {
          return compareAndSet(NOT_RUN, CANCELLED);
        }
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 01 21:46:34 GMT 2024
    - 22.1K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/Striped.java

          if (existing != null) {
            return existing;
          }
          L created = supplier.get();
          ArrayReference<L> newRef = new ArrayReference<>(created, index, queue);
          while (!locks.compareAndSet(index, existingRef, newRef)) {
            // we raced, we need to re-read and try again
            existingRef = locks.get(index);
            existing = existingRef == null ? null : existingRef.get();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 10 20:55:18 GMT 2023
    - 20.3K bytes
    - Viewed (1)
Back to top