Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 60 for AtomicInteger (0.15 sec)

  1. android/guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java

       */
      public void testAdd_withFailures() {
        AtomicInteger existing = new AtomicInteger(12);
        AtomicInteger existingZero = new AtomicInteger(0);
    
        // initial map.get()
        when(backingMap.get(KEY)).thenReturn(null);
        // since get returned null, try a putIfAbsent; that fails due to a simulated race
        when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(existingZero);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 14.2K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/cache/TestingCacheLoaders.java

       * and {@link #getReloadCount}.
       */
      static class IncrementingLoader extends CacheLoader<Integer, Integer> {
        private final AtomicInteger countLoad = new AtomicInteger();
        private final AtomicInteger countReload = new AtomicInteger();
    
        @Override
        public Integer load(Integer key) {
          countLoad.incrementAndGet();
          return key;
        }
    
        @GwtIncompatible // reload
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/testing/ForwardingWrapperTester.java

        private final Class<T> interfaceType;
        private final Method method;
        private final @Nullable Object[] passedArgs;
        private final @Nullable Object returnValue;
        private final AtomicInteger called = new AtomicInteger();
    
        InteractionTester(Class<T> interfaceType, Method method) {
          this.interfaceType = interfaceType;
          this.method = method;
          this.passedArgs = getParameterValues(method);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 13:00:28 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java

       */
      public void testAdd_withFailures() {
        AtomicInteger existing = new AtomicInteger(12);
        AtomicInteger existingZero = new AtomicInteger(0);
    
        // initial map.get()
        when(backingMap.get(KEY)).thenReturn(null);
        // since get returned null, try a putIfAbsent; that fails due to a simulated race
        when(backingMap.putIfAbsent(eq(KEY), isA(AtomicInteger.class))).thenReturn(existingZero);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 14.2K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetBasherTest.java

      public void testAddAndRemove_concurrentHashMap() throws Exception {
        testAddAndRemove(new ConcurrentHashMap<String, AtomicInteger>());
      }
    
      public void testAddAndRemove_concurrentSkipListMap() throws Exception {
        testAddAndRemove(new ConcurrentSkipListMap<String, AtomicInteger>());
      }
    
      public void testAddAndRemove_mapMakerMap() throws Exception {
        MapMaker mapMaker = new MapMaker();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java

       */
      public void testBuilder_bruteForce() {
        for (int i = 0; i < reduceIterationsIfGwt(100); i++) {
          ImmutableIntArray.Builder builder = ImmutableIntArray.builder(RANDOM.nextInt(20));
          AtomicInteger counter = new AtomicInteger(0);
          while (counter.get() < 1000) {
            BuilderOp op = BuilderOp.randomOp();
            op.doIt(builder, counter);
          }
          ImmutableIntArray iia = builder.build();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/primitives/ImmutableDoubleArrayTest.java

       */
      public void testBuilder_bruteForce() {
        for (int i = 0; i < reduceIterationsIfGwt(100); i++) {
          ImmutableDoubleArray.Builder builder = ImmutableDoubleArray.builder(RANDOM.nextInt(20));
          AtomicInteger counter = new AtomicInteger(0);
          while (counter.get() < 1000) {
            BuilderOp op = BuilderOp.randomOp();
            op.doIt(builder, counter);
          }
          ImmutableDoubleArray iia = builder.build();
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 21.2K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java

        while (true) {
          AtomicInteger existingCounter = safeGet(countMap, element);
          if (existingCounter == null) {
            existingCounter = countMap.putIfAbsent(element, new AtomicInteger(occurrences));
            if (existingCounter == null) {
              return 0;
            }
            // existingCounter != null: fall through to operate against the existing AtomicInteger
          }
    
          while (true) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/CacheLoaderTest.java

        private void runNext() {
          tasks.removeFirst().run();
        }
      }
    
      public void testAsyncReload() throws Exception {
        final AtomicInteger loadCount = new AtomicInteger();
        final AtomicInteger reloadCount = new AtomicInteger();
        final AtomicInteger loadAllCount = new AtomicInteger();
    
        CacheLoader<Object, Object> baseLoader =
            new CacheLoader<Object, Object>() {
              @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java

        // Verify that all of the runnables execute in a reasonable amount of time.
        assertTrue(countDownLatch.await(1L, SECONDS));
      }
    
      public void testExecute_idempotent() {
        final AtomicInteger runCalled = new AtomicInteger();
        list.add(
            new Runnable() {
              @Override
              public void run() {
                runCalled.getAndIncrement();
              }
            },
            directExecutor());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 22:10:29 UTC 2024
    - 4.7K bytes
    - Viewed (0)
Back to top