Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 104 for CountDownLatch (0.32 sec)

  1. android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

      // Ordinary tests of successful method execution
      // ----------------------------------------------------------------
    
      public void testAwait_CountDownLatch() {
        final CountDownLatch latch = new CountDownLatch(1);
        Object x =
            new Object() {
              @Override
              protected void finalize() {
                latch.countDown();
              }
            };
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java

        waitUntilClosed(closingFuture);
        futureCancelled.countDown();
      }
    
      private <V> ValueAndCloser<V> finishToValueAndCloser(ClosingFuture<V> closingFuture) {
        final CountDownLatch valueAndCloserSet = new CountDownLatch(1);
        closingFuture.finishToValueAndCloser(
            new ValueAndCloserConsumer<V>() {
              @Override
              public void accept(ValueAndCloser<V> valueAndCloser) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/MapMakerTest.java

        tester.testAllPublicInstanceMethods(new MapMaker());
      }
    
      @GwtIncompatible // threads
      static final class DelayingIdentityLoader<T> implements Function<T, T> {
        private final CountDownLatch delayLatch;
    
        DelayingIdentityLoader(CountDownLatch delayLatch) {
          this.delayLatch = delayLatch;
        }
    
        @Override
        public T apply(T key) {
          awaitUninterruptibly(delayLatch);
          return key;
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Feb 26 16:35:21 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java

      // Regression test for a deadlock where a task could be stuck busy waiting for the task to
      // transition to DONE
      public void testInterruptThrows() throws Exception {
        final CountDownLatch isInterruptibleRegistered = new CountDownLatch(1);
        InterruptibleTask<@Nullable Void> task =
            new InterruptibleTask<@Nullable Void>() {
              @Override
              @Nullable Void runInterruptibly() throws Exception {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

          delayNanos,
        )
      }
    
      /** Returns a latch that reaches 0 when the queue is next idle. */
      fun idleLatch(): CountDownLatch {
        taskRunner.lock.withLock {
          // If the queue is already idle, that's easy.
          if (activeTask == null && futureTasks.isEmpty()) {
            return CountDownLatch(0)
          }
    
          // If there's an existing AwaitIdleTask, use it. This is necessary when the executor is
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/cache/LocalLoadingCacheTest.java

        recursiveCache = CacheBuilder.newBuilder().weakKeys().weakValues().build(recursiveLoader);
        cacheRef.set(recursiveCache);
    
        // tells the test when the computation has completed
        final CountDownLatch doneSignal = new CountDownLatch(1);
    
        Thread thread =
            new Thread() {
              @Override
              public void run() {
                try {
                  cacheRef.get().getUnchecked(3);
                } finally {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 12.3K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/collect/QueuesTest.java

        }
      }
    
      private static class Producer implements Callable<@Nullable Void> {
        final BlockingQueue<Object> q;
        final int elements;
        final CountDownLatch beganProducing = new CountDownLatch(1);
        final CountDownLatch doneProducing = new CountDownLatch(1);
    
        Producer(BlockingQueue<Object> q, int elements) {
          this.q = q;
          this.elements = elements;
        }
    
        @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java

        assertSame(listenableFuture, listenInPoolThread(listenableFuture));
      }
    
      private static class SingleCallListener implements Runnable {
    
        private boolean expectCall = false;
        private final CountDownLatch calledCountDown = new CountDownLatch(1);
    
        @Override
        public void run() {
          assertTrue("Listener called before it was expected", expectCall);
          assertFalse("Listener called more than once", wasCalled());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val responseDequeuedLatches =
          Arrays.asList(
            CountDownLatch(1),
            // No synchronization for the last request, which is not canceled:
            CountDownLatch(1),
            CountDownLatch(0),
          )
        val requestCanceledLatches =
          Arrays.asList(
            CountDownLatch(1),
            CountDownLatch(1),
            CountDownLatch(0),
          )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java

        waitUntilClosed(closingFuture);
        futureCancelled.countDown();
      }
    
      private <V> ValueAndCloser<V> finishToValueAndCloser(ClosingFuture<V> closingFuture) {
        final CountDownLatch valueAndCloserSet = new CountDownLatch(1);
        closingFuture.finishToValueAndCloser(
            new ValueAndCloserConsumer<V>() {
              @Override
              public void accept(ValueAndCloser<V> valueAndCloser) {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.7K bytes
    - Viewed (0)
Back to top