- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 49 for CountDownLatch (0.07 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();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 4.7K bytes - Viewed (0) -
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 unused = new Object() { @SuppressWarnings({"removal", "Finalize"}) // b/260137033 @Override protected void finalize() { latch.countDown();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 17 02:42:09 UTC 2024 - 7.9K 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
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Mon Oct 21 15:41:36 UTC 2024 - 7.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/InterruptibleTaskTest.java
// 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 { BrokenChannel bc = new BrokenChannel();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 6.6K bytes - Viewed (0) -
compat/maven-embedder/src/test/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListenerTest.java
class ConsoleMavenTransferListenerTest { private CountDownLatch startLatch; private CountDownLatch endLatch; @Test void testTransferProgressedWithPrintResourceNames() throws Exception { int size = 1000; ExecutorService service = Executors.newFixedThreadPool(size * 2); startLatch = new CountDownLatch(size); endLatch = new CountDownLatch(size);
Registered: Sun Nov 03 03:35:11 UTC 2024 - Last Modified: Fri Oct 25 12:31:46 UTC 2024 - 5K 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 =
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 4.7K bytes - Viewed (0) -
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();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 15:00:32 UTC 2024 - 24.9K bytes - Viewed (0) -
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
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Oct 22 13:49:09 UTC 2024 - 6.5K bytes - Viewed (0) -
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);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 11.6K bytes - Viewed (0) -
android/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() {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 12.7K bytes - Viewed (0)