- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for idleLatch (0.07 sec)
-
okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerTest.kt
redQueue.execute("task") { log += "run@${taskFaker.nanoTime}" } val idleLatch1 = redQueue.idleLatch() val idleLatch2 = redQueue.idleLatch() assertThat(idleLatch2).isSameAs(idleLatch1) } @Test fun cancelAllWhenEmptyDoesNotStartWorkerThread() { redQueue.execute("red task", 100.µs) { error("expected to be canceled") }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 29 00:33:04 UTC 2024 - 23K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/concurrent/TaskRunnerRealBackendTest.kt
queue.schedule("task") { Thread.sleep(250) backend.shutdown() return@schedule -1L } assertThat(queue.idleLatch().await(500L, TimeUnit.MILLISECONDS)).isTrue() assertThat(queue.idleLatch().count).isEqualTo(0) }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 3.5K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt
// We wait at most 1 second, so we don't ever turn multiple lost threads into // a test timeout failure. val waitTime = (entryTime + 1_000_000_000L - System.nanoTime()) if (!queue.idleLatch().await(waitTime, TimeUnit.NANOSECONDS)) { TaskRunner.INSTANCE.lock.withLock { TaskRunner.INSTANCE.cancelAll() } fail<Unit>("Queue still active after 1000 ms") } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 10.5K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 7.5K bytes - Viewed (0) -
okhttp/src/main/kotlin/okhttp3/internal/ws/RealWebSocket.kt
streamsToClose?.closeQuietly() } /** For testing: force this web socket to release its threads. */ @Throws(InterruptedException::class) fun tearDown() { taskQueue.shutdown() taskQueue.idleLatch().await(10, TimeUnit.SECONDS) } @Synchronized fun sentPingCount(): Int = sentPingCount @Synchronized fun receivedPingCount(): Int = receivedPingCount
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Apr 01 14:21:25 UTC 2024 - 22.1K bytes - Viewed (0) -
mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt
// Cause acceptConnections() to break out. serverSocket.close() // Await shutdown. for (queue in taskRunner.activeQueues()) { if (!queue.idleLatch().await(5, TimeUnit.SECONDS)) { throw IOException("Gave up waiting for queue to shut down") } } taskRunnerBackend.shutdown() } private fun serveConnection(raw: Socket) {
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Mar 31 17:16:15 UTC 2024 - 37.4K bytes - Viewed (0)