Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 104 for CountDownLatch (0.18 sec)

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

        ExecutorService service = Executors.newFixedThreadPool(4);
        ListenerCallQueue<Object> queue = new ListenerCallQueue<>();
        try {
          queue.addListener(listener, service);
    
          final CountDownLatch latch = new CountDownLatch(1);
          Multiset<Object> counters = ConcurrentHashMultiset.create();
          queue.enqueue(incrementingEvent(counters, listener, 1));
          queue.enqueue(incrementingEvent(counters, listener, 2));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

      // Signals that the function is waiting to complete
      private CountDownLatch funcIsWaitingLatch;
      // Signals the function so it will complete
      private CountDownLatch funcCompletionLatch;
    
      @Override
      protected ListenableFuture<String> buildChainingFuture(ListenableFuture<Integer> inputFuture) {
        outputFuture = SettableFuture.create();
        funcIsWaitingLatch = new CountDownLatch(1);
        funcCompletionLatch = new CountDownLatch(1);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.1K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/testing/GcFinalization.java

     * period or an interrupt while waiting for the expected event will result in a {@link
     * RuntimeException}.
     *
     * <p>Here's an example that tests a {@code finalize} method:
     *
     * <pre>{@code
     * final CountDownLatch latch = new CountDownLatch(1);
     * Object x = new MyClass() {
     *   ...
     *   protected void finalize() { latch.countDown(); ... }
     * };
     * x = null;  // Hint to the JIT that x is stack-unreachable
     * GcFinalization.await(latch);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java

                .build(computingFunction);
    
        // seed the map, so its segment's count > 0
        cache.getUnchecked("a");
        shouldWait.set(true);
    
        final CountDownLatch computationStarted = new CountDownLatch(1);
        final CountDownLatch computationComplete = new CountDownLatch(1);
        new Thread(
                new Runnable() {
                  @Override
                  public void run() {
                    computationStarted.countDown();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 23.2K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java

     */
    public class AbstractExecutionThreadServiceTest extends TestCase {
    
      private final TearDownStack tearDownStack = new TearDownStack(true);
      private final CountDownLatch enterRun = new CountDownLatch(1);
      private final CountDownLatch exitRun = new CountDownLatch(1);
    
      private Thread executionThread;
      private Throwable thrownByExecutionThread;
      private final Executor exceptionCatchingExecutor =
          new Executor() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  6. maven-core/src/test/java/org/apache/maven/plugin/internal/DefaultLegacySupportTest.java

    import java.util.concurrent.CountDownLatch;
    
    import org.apache.maven.execution.DefaultMavenExecutionRequest;
    import org.apache.maven.execution.MavenExecutionRequest;
    import org.apache.maven.execution.MavenSession;
    import org.junit.jupiter.api.Test;
    
    import static org.junit.jupiter.api.Assertions.assertNull;
    
    /**
     */
    class DefaultLegacySupportTest {
        final CountDownLatch latch = new CountDownLatch(1);
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Wed Sep 06 08:39:32 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

      private final Timeout timeout;
      private final Outcome expectedOutcome;
      private final Monitor monitor;
      private final FlagGuard guard;
      private final CountDownLatch tearDownLatch;
      private final CountDownLatch doingCallLatch;
      private final CountDownLatch callCompletedLatch;
    
      private GeneratedMonitorTest(
          Method method,
          Scenario scenario,
          boolean fair,
          @Nullable Timeout timeout,
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Mon Apr 17 14:48:57 GMT 2023
    - 27.4K bytes
    - Viewed (0)
  8. android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java

          throws Exception {
        ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads);
        final CountDownLatch startLatch = new CountDownLatch(numberOfThreads);
        final CountDownLatch doneLatch = new CountDownLatch(numberOfThreads);
        for (int i = numberOfThreads; i > 0; i--) {
          @SuppressWarnings("unused") // https://errorprone.info/bugpattern/FutureReturnValueIgnored
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 06 14:40:46 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java

      // Signals that the function is waiting to complete
      private CountDownLatch funcIsWaitingLatch;
      // Signals the function so it will complete
      private CountDownLatch funcCompletionLatch;
    
      @Override
      protected ListenableFuture<String> buildChainingFuture(ListenableFuture<Integer> inputFuture) {
        outputFuture = SettableFuture.create();
        funcIsWaitingLatch = new CountDownLatch(1);
        funcCompletionLatch = new CountDownLatch(1);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.1K bytes
    - Viewed (0)
  10. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Mon Feb 26 16:35:21 GMT 2024
    - 2.6K bytes
    - Viewed (0)
Back to top