Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for nanos (0.01 sec)

  1. guava/src/com/google/common/util/concurrent/DirectExecutorService.java

        long nanos = unit.toNanos(timeout);
        synchronized (lock) {
          while (true) {
            if (shutdown && runningTasks == 0) {
              return true;
            } else if (nanos <= 0) {
              return false;
            } else {
              long now = System.nanoTime();
              NANOSECONDS.timedWait(lock, nanos);
              nanos -= System.nanoTime() - now; // subtract the actual time we waited
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Apr 12 15:07:59 UTC 2025
    - 3.5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/DirectExecutorService.java

        long nanos = unit.toNanos(timeout);
        synchronized (lock) {
          while (true) {
            if (shutdown && runningTasks == 0) {
              return true;
            } else if (nanos <= 0) {
              return false;
            } else {
              long now = System.nanoTime();
              NANOSECONDS.timedWait(lock, nanos);
              nanos -= System.nanoTime() - now; // subtract the actual time we waited
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Apr 12 15:07:59 UTC 2025
    - 3.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/base/Suppliers.java

          long nanos = expirationNanos;
          long now = System.nanoTime();
          if (nanos == 0 || now - nanos >= 0) {
            synchronized (lock) {
              if (nanos == expirationNanos) { // recheck for lost race
                T t = delegate.get();
                value = t;
                nanos = now + durationNanos;
                // In the very unlikely event that nanos is 0, set it to 1;
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 16.5K bytes
    - Viewed (0)
  4. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/concurrent/Lockable.kt

    internal inline fun Lockable.notify() = (this as Object).notify()
    
    internal inline fun Lockable.notifyAll() = (this as Object).notifyAll()
    
    internal inline fun Lockable.awaitNanos(nanos: Long) {
      val ms = nanos / 1_000_000L
      val ns = nanos - (ms * 1_000_000L)
      if (ms > 0L || nanos > 0) {
        (this as Object).wait(ms, ns.toInt())
      }
    }
    
    internal inline fun Lockable.assertLockNotHeld() {
      if (assertionsEnabled && Thread.holdsLock(this)) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 23:28:25 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/Suppliers.java

          long nanos = expirationNanos;
          long now = System.nanoTime();
          if (nanos == 0 || now - nanos >= 0) {
            synchronized (lock) {
              if (nanos == expirationNanos) { // recheck for lost race
                T t = delegate.get();
                value = t;
                nanos = now + durationNanos;
                // In the very unlikely event that nanos is 0, set it to 1;
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 16.5K bytes
    - Viewed (0)
  6. mockwebserver/src/main/kotlin/mockwebserver3/internal/MockWebServerSocket.kt

        javaNetSocket.shutdownInput()
      }
    
      fun shutdownOutput() {
        javaNetSocket.shutdownOutput()
      }
    
      /** Sleeps [nanos], throwing if the socket is closed before that period has elapsed. */
      fun sleepWhileOpen(nanos: Long) {
        var ms = nanos / 1_000_000L
        val ns = nanos - (ms * 1_000_000L)
    
        while (ms > 100) {
          Thread.sleep(100)
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  7. guava-testlib/src/com/google/common/testing/FakeTicker.java

     *
     * <p>This class is thread-safe.
     *
     * @author Jige Yu
     * @since 10.0
     */
    @NullMarked
    @GwtCompatible
    public class FakeTicker extends Ticker {
    
      private final AtomicLong nanos = new AtomicLong();
      private volatile long autoIncrementStepNanos;
    
      /** Advances the ticker value by {@code time} in {@code timeUnit}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Apr 14 15:16:19 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/testing/FakeTicker.java

     *
     * <p>This class is thread-safe.
     *
     * @author Jige Yu
     * @since 10.0
     */
    @NullMarked
    @GwtCompatible
    public class FakeTicker extends Ticker {
    
      private final AtomicLong nanos = new AtomicLong();
      private volatile long autoIncrementStepNanos;
    
      /** Advances the ticker value by {@code time} in {@code timeUnit}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Apr 14 15:16:19 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  9. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/concurrent/TaskRunner.kt

        @Throws(InterruptedException::class)
        @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
        override fun coordinatorWait(
          taskRunner: TaskRunner,
          nanos: Long,
        ) {
          taskRunner.assertLockHeld()
          if (nanos > 0) {
            taskRunner.awaitNanos(nanos)
          }
        }
    
        override fun <T> decorate(queue: BlockingQueue<T>) = queue
    
        override fun execute(
          taskRunner: TaskRunner,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:30:11 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  10. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

            override fun coordinatorWait(
              taskRunner: TaskRunner,
              nanos: Long,
            ) {
              taskRunner.assertLockHeld()
              check(waitingCoordinatorTask == null)
              if (nanos == 0L) return
    
              // Yield until notified, interrupted, or the duration elapses.
              val waitUntil = nanoTime + nanos
              val self = currentTask
              waitingCoordinatorTask = self
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed May 28 23:28:25 UTC 2025
    - 11.9K bytes
    - Viewed (0)
Back to top