Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 104 for CountDownLatch (0.07 sec)

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

     */
    @NullUnmarked
    public class ListenableFutureTaskTest extends TestCase {
    
      private ExecutorService exec;
    
      protected final CountDownLatch runLatch = new CountDownLatch(1);
      protected final CountDownLatch taskLatch = new CountDownLatch(1);
      protected final CountDownLatch listenerLatch = new CountDownLatch(1);
    
      protected volatile boolean throwException = false;
    
      protected final ListenableFutureTask<Integer> task =
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 11 21:00:51 UTC 2025
    - 4.8K bytes
    - Viewed (0)
  2. fess-crawler-opensearch/src/test/java/org/codelibs/fess/crawler/client/FesenClientTest.java

        @Test
        public void testThreadSafeListenerManagement() throws Exception {
            final int numThreads = 10;
            final ExecutorService executor = Executors.newFixedThreadPool(numThreads);
            final CountDownLatch latch = new CountDownLatch(numThreads);
            final AtomicInteger callbackCount = new AtomicInteger(0);
    
            // Add listeners concurrently from multiple threads
            for (int i = 0; i < numThreads; i++) {
    Registered: Sat Dec 20 11:21:39 UTC 2025
    - Last Modified: Thu Nov 20 08:44:44 UTC 2025
    - 17K bytes
    - Viewed (0)
  3. src/test/java/jcifs/util/SmbCircuitBreakerTest.java

            try {
                assertEquals(0, cbWithTracking.getActiveRequests(), "Initial active requests should be 0");
    
                CountDownLatch startLatch = new CountDownLatch(1);
                CountDownLatch holdLatch = new CountDownLatch(1);
                CountDownLatch completeLatch = new CountDownLatch(1);
    
                // Start a long-running operation
                Thread longRunningThread = new Thread(() -> {
                    try {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/fess/suggest/concurrent/DeferredTest.java

                } catch (InterruptedException ignore) {}
                deferred.resolve(new SuggestResponse("", 0, Collections.emptyList(), 0, null));
            });
            th.start();
    
            final CountDownLatch latch = new CountDownLatch(1);
            deferred.promise().then(response -> latch.countDown());
            assertTrue(latch.await(10, TimeUnit.SECONDS));
        }
    
        @Test
        public void test_doneAfterResolve() throws Exception {
    Registered: Sat Dec 20 13:04:59 UTC 2025
    - Last Modified: Sat Mar 15 06:51:20 UTC 2025
    - 4.8K bytes
    - Viewed (0)
  5. 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 = newCachedThreadPool();
    
        future.addListener(listenerLatch::countDown, exec);
    
        new Thread(
                () -> {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Fri Jul 11 18:52:30 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  6. 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);
    
        CountDownLatch computationStarted = new CountDownLatch(1);
        CountDownLatch computationComplete = new CountDownLatch(1);
        new Thread(
                new Runnable() {
                  @Override
                  public void run() {
                    computationStarted.countDown();
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Sep 30 22:03:28 UTC 2025
    - 25.4K bytes
    - Viewed (0)
  7. android/guava-testlib/test/com/google/common/testing/FakeTickerTest.java

          throws Exception {
        ExecutorService executorService = newFixedThreadPool(numberOfThreads);
        CountDownLatch startLatch = new CountDownLatch(numberOfThreads);
        CountDownLatch doneLatch = new CountDownLatch(numberOfThreads);
        for (int i = numberOfThreads; i > 0; i--) {
          @SuppressWarnings("unused") // https://errorprone.info/bugpattern/FutureReturnValueIgnored
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  8. src/test/java/jcifs/internal/smb2/ServerMessageBlock2ResponseTest.java

            void testConcurrentReceived() throws InterruptedException {
                int threadCount = 10;
                CountDownLatch startLatch = new CountDownLatch(1);
                CountDownLatch endLatch = new CountDownLatch(threadCount);
    
                for (int i = 0; i < threadCount; i++) {
                    new Thread(() -> {
                        try {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 19.3K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/AbstractExecutionThreadServiceTest.java

     */
    @NullUnmarked
    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() {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Oct 28 16:03:47 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java

        ExecutorService service = newFixedThreadPool(4);
        ListenerCallQueue<Object> queue = new ListenerCallQueue<>();
        try {
          queue.addListener(listener, service);
    
          CountDownLatch latch = new CountDownLatch(1);
          Multiset<Object> counters = ConcurrentHashMultiset.create();
          queue.enqueue(incrementingEvent(counters, listener, 1));
          queue.enqueue(incrementingEvent(counters, listener, 2));
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Fri Jul 11 18:52:30 UTC 2025
    - 8.2K bytes
    - Viewed (0)
Back to top