Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for idleLatch (0.18 sec)

  1. 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)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

              block()
              return -1L
            }
          },
          delayNanos,
        )
      }
    
      /** Returns a latch that reaches 0 when the queue is next idle. */
      fun idleLatch(): CountDownLatch {
        taskRunner.lock.withLock {
          // If the queue is already idle, that's easy.
          if (activeTask == null && futureTasks.isEmpty()) {
            return CountDownLatch(0)
          }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
Back to top