Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for awaitClear (0.52 sec)

  1. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     *   WeakReference<Foo> weakRef = new WeakReference<>(x);
     *   // ... use x ...
     *   x = null;  // Hint to the JIT that x is stack-unreachable
     *   return weakRef;
     * }
     * public void testFooLeak() {
     *   GcFinalization.awaitClear(fooWeakRef());
     * }
     * }
     *
     * <p>This class cannot currently be used to test soft references, since this class does not try to
     * create the memory pressure required to cause soft references to be cleared.
     *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  2. android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

        assertTrue(future.isDone());
        assertTrue(future.isCancelled());
      }
    
      public void testAwaitClear() {
        WeakReference<Object> ref = new WeakReference<>(new Object());
        GcFinalization.awaitClear(ref);
        assertNull(ref.get());
      }
    
      public void testAwaitDone_finalizationPredicate() {
        WeakHashMap<Object, Object> map = new WeakHashMap<>();
        map.put(new Object(), Boolean.TRUE);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java

      public void testWeakImplementations() {
        for (Striped<?> striped : weakImplementations()) {
          WeakReference<Object> weakRef = new WeakReference<>(striped.get(new Object()));
          GcFinalization.awaitClear(weakRef);
        }
      }
    
      @AndroidIncompatible // Presumably GC doesn't trigger, despite our efforts.
      public void testWeakReadWrite() {
        Striped<ReadWriteLock> striped = Striped.lazyWeakReadWriteLock(1000);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/StripedTest.java

      public void testWeakImplementations() {
        for (Striped<?> striped : weakImplementations()) {
          WeakReference<Object> weakRef = new WeakReference<>(striped.get(new Object()));
          GcFinalization.awaitClear(weakRef);
        }
      }
    
      @AndroidIncompatible // Presumably GC doesn't trigger, despite our efforts.
      public void testWeakReadWrite() {
        Striped<ReadWriteLock> striped = Striped.lazyWeakReadWriteLock(1000);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  5. guava-testlib/src/com/google/common/testing/GcFinalization.java

     *   WeakReference<Foo> weakRef = new WeakReference<>(x);
     *   // ... use x ...
     *   x = null;  // Hint to the JIT that x is stack-unreachable
     *   return weakRef;
     * }
     * public void testFooLeak() {
     *   GcFinalization.awaitClear(fooWeakRef());
     * }
     * }
     *
     * <p>This class cannot currently be used to test soft references, since this class does not try to
     * create the memory pressure required to cause soft references to be cleared.
     *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  6. guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

        assertTrue(future.isDone());
        assertTrue(future.isCancelled());
      }
    
      public void testAwaitClear() {
        WeakReference<Object> ref = new WeakReference<>(new Object());
        GcFinalization.awaitClear(ref);
        assertNull(ref.get());
      }
    
      public void testAwaitDone_finalizationPredicate() {
        WeakHashMap<Object, Object> map = new WeakHashMap<>();
        map.put(new Object(), Boolean.TRUE);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/InternersTest.java

        assertSame(canonical, pool.intern(canonical));
    
        WeakReference<Integer> signal = new WeakReference<>(canonical);
        canonical = null; // Hint to the JIT that canonical is unreachable
    
        GcFinalization.awaitClear(signal);
        assertSame(not, pool.intern(not));
      }
    
      public void testAsFunction_simplistic() {
        String canonical = "a";
        String not = new String("a");
    
        Function<String, String> internerFunction =
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 4K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/InternersTest.java

        assertSame(canonical, pool.intern(canonical));
    
        WeakReference<Integer> signal = new WeakReference<>(canonical);
        canonical = null; // Hint to the JIT that canonical is unreachable
    
        GcFinalization.awaitClear(signal);
        assertSame(not, pool.intern(not));
      }
    
      public void testAsFunction_simplistic() {
        String canonical = "a";
        String not = new String("a");
    
        Function<String, String> internerFunction =
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 4K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/collect/AbstractIteratorTest.java

              @Override
              public Object computeNext() {
                return new Object();
              }
            };
        WeakReference<Object> ref = new WeakReference<>(itr.next());
        GcFinalization.awaitClear(ref);
      }
    
      public void testDefaultBehaviorOfPeekForEmptyIteration() {
    
        AbstractIterator<Integer> empty =
            new AbstractIterator<Integer>() {
              private boolean alreadyCalledEndOfData;
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/ExecutionSequencerTest.java

                  }
                },
                directExecutor());
        serializer.submit(toStringCallable(toBeGCed), directExecutor()).cancel(true);
        toBeGCed = null;
        GcFinalization.awaitClear(ref);
      }
    
      private static Callable<String> toStringCallable(Object object) {
        return new Callable<String>() {
          @Override
          public String call() {
            return object.toString();
          }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 20:58:01 UTC 2025
    - 16.1K bytes
    - Viewed (0)
Back to top