Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for compareAndSet (0.17 sec)

  1. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 6.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/AggregateFutureState.java

           * other callers have added to it.
           *
           * This read is guaranteed to get us the right value because we only set this once (here).
           *
           * requireNonNull is safe because either our compareAndSet succeeded or it failed because
           * another thread did it for us.
           */
          seenExceptionsLocal = requireNonNull(seenExceptions);
        }
        return seenExceptionsLocal;
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Dec 14 20:35:03 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

        for (int i = 0; i < 10; i++) {
          final int expectedCount = i;
          list.add(
              new Runnable() {
                @Override
                public void run() {
                  integer.compareAndSet(expectedCount, expectedCount + 1);
                }
              },
              MoreExecutors.directExecutor());
        }
        list.execute();
        assertEquals(10, integer.get());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 4.7K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/AtomicDouble.java

       * @return {@code true} if successful. False return indicates that the actual value was not
       *     bitwise equal to the expected value.
       */
      public final boolean compareAndSet(double expect, double update) {
        return value.compareAndSet(doubleToRawLongBits(expect), doubleToRawLongBits(update));
      }
    
      /**
       * Atomically sets the value to the given updated value if the current value is <a
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Feb 28 21:00:54 GMT 2022
    - 7.2K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java

       * @param update the new value
       * @return true if successful. False return indicates that the actual value was not equal to the
       *     expected value.
       */
      public final boolean compareAndSet(int i, double expect, double update) {
        return longs.compareAndSet(i, doubleToRawLongBits(expect), doubleToRawLongBits(update));
      }
    
      /**
       * Atomically sets the element at position {@code i} to the given updated value if the current
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 8K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

        for (int i = 0; i < 10; i++) {
          final int expectedCount = i;
          list.add(
              new Runnable() {
                @Override
                public void run() {
                  integer.compareAndSet(expectedCount, expectedCount + 1);
                }
              },
              MoreExecutors.directExecutor());
        }
        list.execute();
        assertEquals(10, integer.get());
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 4.7K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/JdkFutureAdapters.java

          executionList.add(listener, exec);
    
          // When a listener is first added, we run a task that will wait for the delegate to finish,
          // and when it is done will run the listeners.
          if (hasListeners.compareAndSet(false, true)) {
            if (delegate.isDone()) {
              // If the delegate is already done, run the execution list immediately on the current
              // thread.
              executionList.execute();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Dec 14 20:35:03 GMT 2023
    - 7.5K bytes
    - Viewed (0)
Back to top