Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for currentThread (0.21 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

      }
    }
    
    internal inline fun threadName(
      name: String,
      block: () -> Unit,
    ) {
      val currentThread = Thread.currentThread()
      val oldName = currentThread.name
      currentThread.name = name
      try {
        block()
      } finally {
        currentThread.name = oldName
      }
    }
    
    /** Returns the Content-Length as reported by the response headers. */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskRunner.kt

      }
    
      private fun runTask(task: Task) {
        val currentThread = Thread.currentThread()
        val oldName = currentThread.name
        currentThread.name = task.name
    
        var delayNanos = -1L
        try {
          delayNanos = task.runOnce()
        } finally {
          lock.withLock {
            afterRun(task, delayNanos)
          }
          currentThread.name = oldName
        }
      }
    
      private fun afterRun(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/cache2/Relay.kt

                if (upstreamReader != null) {
                  timeout.waitUntilNotified(this@Relay)
                  continue
                }
    
                // We will do the read.
                upstreamReader = Thread.currentThread()
                return@synchronized SOURCE_UPSTREAM
              }
    
              val bufferPos = upstreamPos - buffer.size
    
              // Bytes of the read precede the buffer. Read from the file.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.8K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

          throw AssertionError("Thread ${Thread.currentThread().name} MUST hold lock on $this")
        }
      }
    
      @Suppress("NOTHING_TO_INLINE")
      internal inline fun Any.assertThreadDoesntHoldLock() {
        if (assertionsEnabled && taskRunner.lock.isHeldByCurrentThread) {
          throw AssertionError("Thread ${Thread.currentThread().name} MUST NOT hold lock on $this")
        }
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 12.6K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/kt/WiresharkExample.kt

      ) : EventListener() {
        var random: String? = null
        lateinit var currentThread: Thread
    
        private val loggerHandler =
          object : Handler() {
            override fun publish(record: LogRecord) {
              // Try to avoid multi threading issues with concurrent requests
              if (Thread.currentThread() != currentThread) {
                return
              }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.7K bytes
    - Viewed (1)
  6. okhttp/src/test/java/okhttp3/SocksProxy.kt

      fun play() {
        serverSocket = ServerSocket(0)
        executor.execute {
          val threadName = "SocksProxy ${serverSocket!!.localPort}"
          Thread.currentThread().name = threadName
          try {
            while (true) {
              val socket = serverSocket!!.accept()
              connectionCount.incrementAndGet()
              service(socket)
            }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

      private fun sleep(delayMillis: Int) {
        try {
          Thread.sleep(delayMillis.toLong())
        } catch (e: InterruptedException) {
          Thread.currentThread().interrupt()
        }
      }
    
      private fun interruptLater(delayMillis: Int) {
        val toInterrupt = Thread.currentThread()
        val interruptingCow =
          Thread {
            sleep(delayMillis)
            toInterrupt.interrupt()
          }
        interruptingCow.start()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

          readTheListUninterruptibly()
        } else {
          try {
            readCompleteLatch.await()
          } catch (_: InterruptedException) {
            Thread.currentThread().interrupt() // Retain interrupted status.
          }
        }
    
        check(::publicSuffixListBytes.isInitialized) {
          // May have failed with an IOException
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Stream.kt

       * awkward [InterruptedException].
       */
      @Throws(InterruptedIOException::class)
      internal fun waitForIo() {
        try {
          condition.await()
        } catch (_: InterruptedException) {
          Thread.currentThread().interrupt() // Retain interrupted status.
          throw InterruptedIOException()
        }
      }
    
      /**
       * The Okio timeout watchdog will call [timedOut] if the timeout is reached. In that case we close
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 23.2K bytes
    - Viewed (1)
  10. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Connection.kt

                  throw IOException("stream closed")
                }
                condition.await() // Wait until we receive a WINDOW_UPDATE.
              }
            } catch (e: InterruptedException) {
              Thread.currentThread().interrupt() // Retain interrupted status.
              throw InterruptedIOException()
            }
    
            toWrite = minOf(byteCount, writeBytesMaximum - writeBytesTotal).toInt()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 32.6K bytes
    - Viewed (0)
Back to top