- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 77 for CountDownLatch (0.15 sec)
-
android/guava-tests/test/com/google/common/util/concurrent/ExecutionListTest.java
Executor exec = Executors.newCachedThreadPool(); CountDownLatch countDownLatch = new CountDownLatch(3); list.add(new MockRunnable(countDownLatch), exec); list.add(new MockRunnable(countDownLatch), exec); list.add(new MockRunnable(countDownLatch), exec); assertEquals(3L, countDownLatch.getCount()); list.execute();
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Feb 09 22:57:07 GMT 2022 - 4.7K bytes - Viewed (0) -
android/guava-testlib/src/com/google/common/util/concurrent/testing/MockFutureListener.java
public MockFutureListener(ListenableFuture<?> future) { this.countDownLatch = new CountDownLatch(1); this.future = future; future.addListener(this, directExecutor()); } @Override public void run() { countDownLatch.countDown(); } /** * Verify that the listener completes in a reasonable amount of time, and Asserts that the future * returns the expected data. *
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Fri May 12 18:12:42 GMT 2023 - 3K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/TrustedListenableFutureTaskTest.java
@GwtIncompatible // blocking wait public void testCancel_interrupted() throws Exception { final AtomicBoolean interruptedExceptionThrown = new AtomicBoolean(); final CountDownLatch enterLatch = new CountDownLatch(1); final CountDownLatch exitLatch = new CountDownLatch(1); final TrustedListenableFutureTask<Integer> task = TrustedListenableFutureTask.create( new Callable<Integer>() { @Override
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Tue Feb 13 14:28:25 GMT 2024 - 7.3K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java
*/ 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 =
Java - Registered: Fri Apr 12 12:43:09 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 4.7K bytes - Viewed (0) -
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 Apr 12 12:43:09 GMT 2024 - Last Modified: Wed Feb 09 22:57:07 GMT 2022 - 9.7K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java
} public void testAsMapDuringLoading() throws InterruptedException, ExecutionException { final CountDownLatch getStartedSignal = new CountDownLatch(2); final CountDownLatch letGetFinishSignal = new CountDownLatch(1); final CountDownLatch getFinishedSignal = new CountDownLatch(2); final String getKey = "get"; final String refreshKey = "refresh"; final String suffix = "Suffix";
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 86.2K bytes - Viewed (0) -
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) -
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) -
android/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 May 03 12:43:13 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 6.6K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java
*/ 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 =
Java - Registered: Fri May 03 12:43:13 GMT 2024 - Last Modified: Wed Sep 06 17:04:31 GMT 2023 - 4.7K bytes - Viewed (0)