- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 2,167 for latch (0.02 sec)
-
guava-tests/test/com/google/common/util/concurrent/ListenerCallQueueTest.java
queue.enqueue(incrementingEvent(counters, listener, 4)); queue.enqueue(countDownEvent(latch)); assertEquals(0, counters.size()); queue.dispatch(); latch.await(); assertEquals(multiset(listener, 4), counters); } finally { service.shutdown(); } } public void testEnqueueAndDispatch_multithreaded_withThrowingRunnable()
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Feb 09 22:57:07 UTC 2022 - 8.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/util/concurrent/ListenableFutureTaskTest.java
// thread because the task will block on the task latch after unblocking // the run latch. exec.execute(task); runLatch.await(); assertEquals(1, listenerLatch.getCount()); assertFalse(task.isDone()); assertFalse(task.isCancelled()); // Finish the task by unblocking the task latch. Then wait for the // listener to be called by blocking on the listener latch. taskLatch.countDown();
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Oct 18 22:10:29 UTC 2024 - 4.7K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/eventbus/DispatcherTest.java
latch.countDown(); } }) .start(); Uninterruptibles.awaitUninterruptibly(latch); // See Dispatcher.LegacyAsyncDispatcher for an explanation of why there aren't really any // useful testable guarantees about the behavior of that dispatcher in a multithreaded
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Apr 27 15:41:25 UTC 2022 - 5.6K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/AsyncDns.kt
} latch.countDown() } override fun onFailure( hostname: String, e: IOException, ) { synchronized(allExceptions) { allExceptions.add(e) } latch.countDown() } }, )
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Tue Jan 23 14:31:42 UTC 2024 - 3.5K bytes - Viewed (0) -
guava-testlib/src/com/google/common/util/concurrent/testing/AbstractListenableFutureTest.java
public abstract class AbstractListenableFutureTest extends TestCase { protected CountDownLatch latch; protected ListenableFuture<Boolean> future; @Override protected void setUp() throws Exception { // Create a latch and a future that waits on the latch. latch = new CountDownLatch(1); future = createListenableFuture(Boolean.TRUE, null, latch); } @Override protected void tearDown() throws Exception {
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Wed Sep 06 18:30:30 UTC 2023 - 6K bytes - Viewed (0) -
guava/src/com/google/common/util/concurrent/Uninterruptibles.java
/** 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; } catch (InterruptedException e) { interrupted = true;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:51:36 UTC 2024 - 19.1K bytes - Viewed (0) -
mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt
val secondResponseCode = AtomicInteger() val secondRequest = "/bar" val firstRequest = "/foo" val latch = CountDownLatch(1) val dispatcher: Dispatcher = object : Dispatcher() { override fun dispatch(request: RecordedRequest): MockResponse { if (request.path == firstRequest) { latch.await() } return MockResponse() } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3.3K bytes - Viewed (0) -
okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt
call: Call, response: Response, ) { processResponse(response, hostname, responses, failures) latch.countDown() } }, ) } try { latch.await() } catch (e: InterruptedException) { failures.add(e) } } private fun processResponse( response: Response, hostname: String,
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Oct 31 09:27:31 UTC 2024 - 9.8K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt
) { exceptionRef.set(e) latch.countDown() } @Throws(IOException::class) override fun onResponse( call: Call, response: Response, ) { response.close() latch.countDown() } }, ) latch.await() assertThat(call.isCanceled()).isTrue()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.5K bytes - Viewed (0) -
guava-testlib/src/com/google/common/testing/GcFinalization.java
do { System.runFinalization(); if (latch.getCount() == 0) { return; } System.gc(); try { if (latch.await(1L, SECONDS)) { return; } } catch (InterruptedException ie) { throw new RuntimeException("Unexpected interrupt while waiting for latch", ie); } } while (System.nanoTime() - deadline < 0);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 11.6K bytes - Viewed (0)