Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 104 for CountDownLatch (0.25 sec)

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

      private final ExecutorService exec;
      private final ListenableFuture<?> future;
      private final CountDownLatch latch;
    
      public ListenableFutureTester(ListenableFuture<?> future) {
        this.exec = Executors.newCachedThreadPool();
        this.future = checkNotNull(future);
        this.latch = new CountDownLatch(1);
      }
    
      public void setUp() {
        future.addListener(
            new Runnable() {
              @Override
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTester.java

      private final ExecutorService exec;
      private final ListenableFuture<?> future;
      private final CountDownLatch latch;
    
      public ListenableFutureTester(ListenableFuture<?> future) {
        this.exec = Executors.newCachedThreadPool();
        this.future = checkNotNull(future);
        this.latch = new CountDownLatch(1);
      }
    
      public void setUp() {
        future.addListener(
            new Runnable() {
              @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java

       * even permanently blocked.
       */
      public void testListenerDeadlock() throws InterruptedException {
        final CountDownLatch failEnter = new CountDownLatch(1);
        final CountDownLatch failLeave = new CountDownLatch(1);
        final CountDownLatch afterStarted = new CountDownLatch(1);
        Service failRunService =
            new AbstractService() {
              @Override
              protected void doStart() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 02 17:20:27 GMT 2023
    - 23.2K bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java

        assertTrue(successLatch.await(200, MILLISECONDS));
    
        latch.countDown();
      }
    
      public void testListenersNotifiedOnError() throws Exception {
        CountDownLatch successLatch = new CountDownLatch(1);
        CountDownLatch listenerLatch = new CountDownLatch(1);
    
        ExecutorService exec = Executors.newCachedThreadPool();
    
        future.addListener(listenerLatch::countDown, exec);
    
        new Thread(
                () -> {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 18:30:30 GMT 2023
    - 6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java

        public String toString() {
          return name;
        }
      }
    
      static final class Waiter {
        private final CountDownLatch started = new CountDownLatch(1);
        private final CountDownLatch canReturn = new CountDownLatch(1);
        private final CountDownLatch returned = new CountDownLatch(1);
        private Object proxy;
    
        @SuppressWarnings("unchecked") // proxy for a generic class
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 74.7K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/util/concurrent/FuturesTest.java

        SettableFuture<String> input = SettableFuture.create();
        final CountDownLatch inFunction = new CountDownLatch(1);
        final CountDownLatch shouldCompleteFunction = new CountDownLatch(1);
        final CountDownLatch gotException = new CountDownLatch(1);
        AsyncFunction<String, String> function =
            new AsyncFunction<String, String>() {
              @Override
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 144.5K bytes
    - Viewed (0)
  7. mockwebserver/src/main/kotlin/mockwebserver3/internal/duplex/MockStreamHandler.kt

              throw AssertionError("expected IOException")
            } catch (expected: IOException) {
            }
          }
        }
    
      @JvmOverloads
      fun sendResponse(
        s: String,
        responseSent: CountDownLatch = CountDownLatch(0),
      ) = apply {
        actions += { stream ->
          stream.responseBody.writeUtf8(s)
          stream.responseBody.flush()
          responseSent.countDown()
        }
      }
    
      fun exhaustResponse() =
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      // methods is identical, save for method being invoked.
    
      /** Invokes {@code latch.}{@link CountDownLatch#await() await()} uninterruptibly. */
      @J2ktIncompatible
      @GwtIncompatible // concurrency
      public static void awaitUninterruptibly(CountDownLatch latch) {
        boolean interrupted = false;
        try {
          while (true) {
            try {
              latch.await();
              return;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/AbstractFutureInnocuousThreadTest.java

      public void testAbstractFutureInitializationWithInnocuousThread_doesNotThrow() throws Exception {
        CountDownLatch latch = new CountDownLatch(1);
        // Setting a security manager causes the common ForkJoinPool to use InnocuousThreads with no
        // permissions.
        // submit()/join() causes this thread to execute the task instead, so we use a CountDownLatch as
        // a barrier to synchronize.
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Dec 16 19:54:45 GMT 2020
    - 5.1K bytes
    - Viewed (0)
  10. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 7.4K bytes
    - Viewed (0)
Back to top