/libcore/ojluni/src/main/java/java/sql/ |
D | Timestamp.java | 93 nanos = nano; in Timestamp() 110 nanos = (int)((time%1000) * 1000000); in Timestamp() 111 if (nanos < 0) { in Timestamp() 112 nanos = 1000000000 + nanos; in Timestamp() 128 nanos = (int)((time%1000) * 1000000); in setTime() 129 if (nanos < 0) { in setTime() 130 nanos = 1000000000 + nanos; in setTime() 145 return (time + (nanos / 1000000)); in getTime() 152 private int nanos; field in Timestamp 326 if (nanos == 0) { in toString() [all …]
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
D | SystemTest.java | 46 long nanos = n2 - n1; in testNanoTime1() local 47 assertTrue(nanos >= 0); in testNanoTime1() 48 long nanosAsMillis = nanos / 1000000; in testNanoTime1() 66 long nanos = n2 - n1; in testNanoTime2() local 68 assertTrue(nanos >= 0); in testNanoTime2() 69 long nanosAsMillis = nanos / 1000000; in testNanoTime2()
|
D | AbstractQueuedLongSynchronizerTest.java | 62 public boolean tryAcquireNanos(long nanos) throws InterruptedException { in tryAcquireNanos() argument 63 return tryAcquireNanos(LOCKED, nanos); in tryAcquireNanos() 550 long nanos = MILLISECONDS.toNanos(timeoutMillis()); in testAcquireNanos_Timeout() 551 assertFalse(sync.tryAcquireNanos(nanos)); in testAcquireNanos_Timeout() 1155 long nanos = MILLISECONDS.toNanos(2 * LONG_DELAY_MS); 1156 assertTrue(l.tryAcquireSharedNanos(0, nanos)); 1158 assertTrue(l.tryAcquireSharedNanos(0, nanos)); 1196 long nanos = MILLISECONDS.toNanos(2 * LONG_DELAY_MS); 1197 l.tryAcquireSharedNanos(0, nanos); 1219 long nanos = MILLISECONDS.toNanos(millis); [all …]
|
D | AbstractQueuedSynchronizerTest.java | 66 public boolean tryAcquireNanos(long nanos) throws InterruptedException { in tryAcquireNanos() argument 67 return tryAcquireNanos(LOCKED, nanos); in tryAcquireNanos() 553 long nanos = MILLISECONDS.toNanos(timeoutMillis()); in testAcquireNanos_Timeout() 554 assertFalse(sync.tryAcquireNanos(nanos)); in testAcquireNanos_Timeout() 1158 long nanos = MILLISECONDS.toNanos(2 * LONG_DELAY_MS); 1159 assertTrue(l.tryAcquireSharedNanos(0, nanos)); 1161 assertTrue(l.tryAcquireSharedNanos(0, nanos)); 1199 long nanos = MILLISECONDS.toNanos(2 * LONG_DELAY_MS); 1200 l.tryAcquireSharedNanos(0, nanos); 1222 long nanos = MILLISECONDS.toNanos(millis); [all …]
|
D | JSR166TestCase.java | 839 long nanos = millis * (1000 * 1000); in delay() local 840 final long wakeupTime = System.nanoTime() + nanos; in delay() 846 nanos = wakeupTime - System.nanoTime(); in delay() 847 millis = nanos / (1000 * 1000); in delay() 848 } while (nanos >= 0L); in delay()
|
/libcore/luni/src/main/java/java/util/concurrent/locks/ |
D | LockSupport.java | 197 public static void parkNanos(Object blocker, long nanos) { in parkNanos() argument 198 if (nanos > 0) { in parkNanos() 201 U.park(false, nanos); in parkNanos() 322 public static void parkNanos(long nanos) { in parkNanos() argument 323 if (nanos > 0) in parkNanos() 324 U.park(false, nanos); in parkNanos()
|
D | StampedLock.java | 352 long nanos = unit.toNanos(time); in tryWriteLock() local 357 if (nanos <= 0L) in tryWriteLock() 359 if ((deadline = System.nanoTime() + nanos) == 0L) in tryWriteLock() 434 long nanos = unit.toNanos(time); in tryReadLock() local 444 if (nanos <= 0L) in tryReadLock() 446 if ((deadline = System.nanoTime() + nanos) == 0L) in tryReadLock()
|
/libcore/ojluni/src/main/java/java/lang/ |
D | Thread.java | 316 private static native void sleep(Object lock, long millis, int nanos) in sleep() argument 341 public static void sleep(long millis, int nanos) in sleep() argument 346 if (nanos < 0) { in sleep() 347 throw new IllegalArgumentException("nanos < 0: " + nanos); in sleep() 349 if (nanos > 999999) { in sleep() 350 throw new IllegalArgumentException("nanos > 999999: " + nanos); in sleep() 355 if (millis == 0 && nanos == 0) { in sleep() 364 long duration = (millis * NANOS_PER_MILLI) + nanos; in sleep() 371 sleep(lock, millis, nanos); in sleep() 383 nanos = (int) (duration % NANOS_PER_MILLI); in sleep() [all …]
|
D | Object.java | 472 public final native void wait(long millis, int nanos) throws InterruptedException; in wait() argument
|
/libcore/luni/src/main/java/java/util/concurrent/ |
D | CyclicBarrier.java | 170 private int dowait(boolean timed, long nanos) in dowait() argument 207 else if (nanos > 0L) in dowait() 208 nanos = trip.awaitNanos(nanos); in dowait() 227 if (timed && nanos <= 0L) { in dowait()
|
D | SynchronousQueue.java | 157 abstract E transfer(E e, boolean timed, long nanos); in transfer() argument 299 E transfer(E e, boolean timed, long nanos) { in transfer() argument 327 if (timed && nanos <= 0L) { // can't wait in transfer() 333 SNode m = awaitFulfill(s, timed, nanos); in transfer() 384 SNode awaitFulfill(SNode s, boolean timed, long nanos) { in awaitFulfill() argument 407 final long deadline = timed ? System.nanoTime() + nanos : 0L; in awaitFulfill() 419 nanos = deadline - System.nanoTime(); in awaitFulfill() 420 if (nanos <= 0L) { in awaitFulfill() 431 else if (nanos > SPIN_FOR_TIMEOUT_THRESHOLD) in awaitFulfill() 432 LockSupport.parkNanos(this, nanos); in awaitFulfill() [all …]
|
D | DelayQueue.java | 225 long nanos = unit.toNanos(timeout); in poll() local 232 if (nanos <= 0L) in poll() 235 nanos = available.awaitNanos(nanos); in poll() 240 if (nanos <= 0L) in poll() 243 if (nanos < delay || leader != null) in poll() 244 nanos = available.awaitNanos(nanos); in poll() 250 nanos -= delay - timeLeft; in poll()
|
D | AbstractExecutorService.java | 119 boolean timed, long nanos) in doInvokeAny() argument 140 final long deadline = timed ? System.nanoTime() + nanos : 0L; in doInvokeAny() 159 f = ecs.poll(nanos, NANOSECONDS); in doInvokeAny() 162 nanos = deadline - System.nanoTime(); in doInvokeAny() 235 final long nanos = unit.toNanos(timeout); in invokeAll() local 236 final long deadline = System.nanoTime() + nanos; in invokeAll() 248 if (((i == 0) ? nanos : deadline - System.nanoTime()) <= 0L) in invokeAll()
|
D | LinkedBlockingDeque.java | 381 long nanos = unit.toNanos(timeout); in offerFirst() local 386 if (nanos <= 0L) in offerFirst() 388 nanos = notFull.awaitNanos(nanos); in offerFirst() 404 long nanos = unit.toNanos(timeout); in offerLast() local 409 if (nanos <= 0L) in offerLast() 411 nanos = notFull.awaitNanos(nanos); in offerLast() 485 long nanos = unit.toNanos(timeout); in pollFirst() local 491 if (nanos <= 0L) in pollFirst() 493 nanos = notEmpty.awaitNanos(nanos); in pollFirst() 503 long nanos = unit.toNanos(timeout); in pollLast() local [all …]
|
D | Phaser.java | 755 long nanos = unit.toNanos(timeout); in awaitAdvanceInterruptibly() local 762 QNode node = new QNode(this, phase, true, true, nanos); in awaitAdvanceInterruptibly() 1061 long nanos; field in Phaser.QNode 1067 boolean timed, long nanos) { in QNode() argument 1071 this.nanos = nanos; in QNode() 1073 this.deadline = timed ? System.nanoTime() + nanos : 0L; in QNode() 1091 (nanos <= 0L || (nanos = deadline - System.nanoTime()) <= 0L)) { in isReleasable() 1101 LockSupport.parkNanos(this, nanos); in block()
|
D | FutureTask.java | 366 private int awaitDone(boolean timed, long nanos) in awaitDone() argument 394 if (timed && nanos <= 0L) in awaitDone() 407 parkNanos = nanos; in awaitDone() 410 if (elapsed >= nanos) { in awaitDone() 414 parkNanos = nanos - elapsed; in awaitDone()
|
D | ScheduledThreadPoolExecutor.java | 1120 long nanos = unit.toNanos(timeout); in poll() local 1127 if (nanos <= 0L) in poll() 1130 nanos = available.awaitNanos(nanos); in poll() 1135 if (nanos <= 0L) in poll() 1138 if (nanos < delay || leader != null) in poll() 1139 nanos = available.awaitNanos(nanos); in poll() 1145 nanos -= delay - timeLeft; in poll()
|
D | LinkedBlockingQueue.java | 347 long nanos = unit.toNanos(timeout); in offer() local 354 if (nanos <= 0L) in offer() 356 nanos = notFull.awaitNanos(nanos); in offer() 430 long nanos = unit.toNanos(timeout); in poll() local 436 if (nanos <= 0L) in poll() 438 nanos = notEmpty.awaitNanos(nanos); in poll()
|
D | ArrayBlockingQueue.java | 327 long nanos = unit.toNanos(timeout); in offer() local 332 if (nanos <= 0L) in offer() 334 nanos = notFull.awaitNanos(nanos); in offer() 366 long nanos = unit.toNanos(timeout); in poll() local 371 if (nanos <= 0L) in poll() 373 nanos = notEmpty.awaitNanos(nanos); in poll()
|
D | LinkedTransferQueue.java | 570 private E xfer(E e, boolean haveData, int how, long nanos) { in xfer() argument 611 return awaitMatch(s, pred, e, (how == TIMED), nanos); in xfer() 664 private E awaitMatch(Node s, Node pred, E e, boolean timed, long nanos) { in awaitMatch() argument 665 final long deadline = timed ? System.nanoTime() + nanos : 0L; in awaitMatch() 678 else if (w.isInterrupted() || (timed && nanos <= 0L)) { in awaitMatch() 696 nanos = deadline - System.nanoTime(); in awaitMatch() 697 if (nanos > 0L) in awaitMatch() 698 LockSupport.parkNanos(this, nanos); in awaitMatch()
|
D | PriorityBlockingQueue.java | 527 long nanos = unit.toNanos(timeout); in poll() local 532 while ( (result = dequeue()) == null && nanos > 0) in poll() 533 nanos = notEmpty.awaitNanos(nanos); in poll()
|
D | ThreadPoolExecutor.java | 1445 long nanos = unit.toNanos(timeout); in awaitTermination() local 1450 if (nanos <= 0L) in awaitTermination() 1452 nanos = termination.awaitNanos(nanos); in awaitTermination()
|
D | CompletableFuture.java | 1660 long nanos; // remaining wait time if timed field in CompletableFuture.Signaller 1666 Signaller(boolean interruptible, long nanos, long deadline) { in Signaller() argument 1669 this.nanos = nanos; in Signaller() 1685 (nanos <= 0L || in isReleasable() 1686 (nanos = deadline - System.nanoTime()) <= 0L)) || in isReleasable() 1694 LockSupport.parkNanos(this, nanos); in block() 1747 private Object timedGet(long nanos) throws TimeoutException { in timedGet() argument 1750 if (nanos > 0L) { in timedGet() 1751 long d = System.nanoTime() + nanos; in timedGet() 1758 q = new Signaller(true, nanos, deadline); in timedGet() [all …]
|
D | ForkJoinTask.java | 989 long nanos = unit.toNanos(timeout); in get() local 992 if ((s = status) >= 0 && nanos > 0L) { in get() 993 long d = System.nanoTime() + nanos; in get()
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | CharacterBenchmark.java | 41 public double nanosToUnits(double nanos) { in nanosToUnits() argument 42 return nanos / 65536; in nanosToUnits()
|