/libcore/ojluni/src/main/java/java/time/ |
D | Duration.java | 161 private final int nanos; field in Duration 275 public static Duration ofNanos(long nanos) { in ofNanos() argument 276 long secs = nanos / NANOS_PER_SECOND; in ofNanos() 277 int nos = (int) (nanos % NANOS_PER_SECOND); in ofNanos() 400 int nanos = parseFraction(text, fractionMatch, seconds < 0 ? -1 : 1); in parse() local 402 return create(negate, daysAsSecs, hoursAsSecs, minsAsSecs, seconds, nanos); in parse() 438 … create(boolean negate, long daysAsSecs, long hoursAsSecs, long minsAsSecs, long secs, int nanos) { in create() argument 441 return ofSeconds(seconds, nanos).negated(); in create() 443 return ofSeconds(seconds, nanos); in create() 473 long nanos; in between() [all …]
|
D | Instant.java | 253 private final int nanos; field in Instant 418 private Instant(long epochSecond, int nanos) { in Instant() argument 421 this.nanos = nanos; in Instant() 556 case NANO_OF_SECOND: return nanos; in get() 557 case MICRO_OF_SECOND: return nanos / 1000; in get() 558 case MILLI_OF_SECOND: return nanos / 1000_000; in get() 592 case NANO_OF_SECOND: return nanos; in getLong() 593 case MICRO_OF_SECOND: return nanos / 1000; in getLong() 594 case MILLI_OF_SECOND: return nanos / 1000_000; in getLong() 626 return nanos; in getNano() [all …]
|
/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()
|
/libcore/ojluni/src/test/java/util/concurrent/tck/ |
D | SystemTest.java | 70 long nanos = n2 - n1; in testNanoTime1() local 71 assertTrue(nanos >= 0); in testNanoTime1() 72 long nanosAsMillis = nanos / 1000000; in testNanoTime1() 90 long nanos = n2 - n1; in testNanoTime2() local 92 assertTrue(nanos >= 0); in testNanoTime2() 93 long nanosAsMillis = nanos / 1000000; in testNanoTime2()
|
/libcore/ojluni/src/main/java/java/util/concurrent/locks/ |
D | LockSupport.java | 248 public static void parkNanos(Object blocker, long nanos) { in parkNanos() argument 249 if (nanos > 0) { in parkNanos() 252 U.park(false, nanos); in parkNanos() 374 public static void parkNanos(long nanos) { in parkNanos() argument 375 if (nanos > 0) in parkNanos() 376 U.park(false, nanos); in parkNanos()
|
D | StampedLock.java | 508 long nanos = unit.toNanos(time); in tryWriteLock() local 513 if (nanos <= 0L) in tryWriteLock() 515 nextState = acquireWrite(true, true, System.nanoTime() + nanos); in tryWriteLock() 582 long nanos = unit.toNanos(time); in tryReadLock() local 587 if (nanos <= 0L) in tryReadLock() 589 nextState = acquireRead(true, true, System.nanoTime() + nanos); in tryReadLock() 1248 long nanos; in acquireWrite() local 1252 else if ((nanos = time - System.nanoTime()) > 0L) in acquireWrite() 1253 LockSupport.parkNanos(this, nanos); in acquireWrite() 1316 long nanos = 0L; in acquireRead() local [all …]
|
D | AbstractQueuedSynchronizer.java | 712 long nanos; in acquire() local 716 else if ((nanos = time - System.nanoTime()) > 0L) in acquire() 717 LockSupport.parkNanos(this, nanos); in acquire() 1663 long nanos = (nanosTimeout < 0L) ? 0L : nanosTimeout; in awaitNanos() local 1664 long deadline = System.nanoTime() + nanos; in awaitNanos() 1668 (nanos = deadline - System.nanoTime()) <= 0L) { in awaitNanos() 1672 LockSupport.parkNanos(this, nanos); in awaitNanos() 1748 long nanos = (nanosTimeout < 0L) ? 0L : nanosTimeout; in await() local 1749 long deadline = System.nanoTime() + nanos; in await() 1753 (nanos = deadline - System.nanoTime()) <= 0L) { in await() [all …]
|
D | AbstractQueuedLongSynchronizer.java | 347 long nanos; in acquire() local 351 else if ((nanos = time - System.nanoTime()) > 0L) in acquire() 352 LockSupport.parkNanos(this, nanos); in acquire() 1297 long nanos = (nanosTimeout < 0L) ? 0L : nanosTimeout; in awaitNanos() local 1298 long deadline = System.nanoTime() + nanos; in awaitNanos() 1302 (nanos = deadline - System.nanoTime()) <= 0L) { in awaitNanos() 1306 LockSupport.parkNanos(this, nanos); in awaitNanos() 1382 long nanos = (nanosTimeout < 0L) ? 0L : nanosTimeout; in await() local 1383 long deadline = System.nanoTime() + nanos; in await() 1387 (nanos = deadline - System.nanoTime()) <= 0L) { in await() [all …]
|
/libcore/ojluni/src/main/java/java/nio/file/attribute/ |
D | FileTime.java | 150 long nanos = unit.convert(instant.getNano(), TimeUnit.NANOSECONDS); in to() local 151 long r = secs + nanos; in to() 153 if (((secs ^ r) & (nanos ^ r)) < 0) { in to() 174 int nanos = instant.getNano(); in toMillis() local 183 return r + nanos / 1000_000; in toMillis() 233 int nanos = 0; in toInstant() local 252 nanos = (int)Math.floorMod(value, MILLIS_PER_SECOND) in toInstant() 257 nanos = (int)Math.floorMod(value, MICROS_PER_SECOND) in toInstant() 262 nanos = (int)Math.floorMod(value, NANOS_PER_SECOND); in toInstant() 271 instant = Instant.ofEpochSecond(secs, nanos); in toInstant() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | DelayQueue.java | 255 long nanos = unit.toNanos(timeout); in poll() local 262 if (nanos <= 0L) in poll() 265 nanos = available.awaitNanos(nanos); in poll() 270 if (nanos <= 0L) in poll() 273 if (nanos < delay || leader != null) in poll() 274 nanos = available.awaitNanos(nanos); in poll() 280 nanos -= delay - timeLeft; in poll()
|
D | CyclicBarrier.java | 201 private int dowait(boolean timed, long nanos) in dowait() argument 237 else if (nanos > 0L) in dowait() 238 nanos = trip.awaitNanos(nanos); in dowait() 257 if (timed && nanos <= 0L) { in dowait()
|
D | AbstractExecutorService.java | 153 boolean timed, long nanos) in doInvokeAny() argument 174 final long deadline = timed ? System.nanoTime() + nanos : 0L; in doInvokeAny() 193 f = ecs.poll(nanos, NANOSECONDS); in doInvokeAny() 196 nanos = deadline - System.nanoTime(); in doInvokeAny() 268 final long nanos = unit.toNanos(timeout); in invokeAll() local 269 final long deadline = System.nanoTime() + nanos; in invokeAll() 281 if (((i == 0) ? nanos : deadline - System.nanoTime()) <= 0L) in invokeAll()
|
D | Phaser.java | 783 long nanos = unit.toNanos(timeout); in awaitAdvanceInterruptibly() local 790 QNode node = new QNode(this, phase, true, true, nanos); in awaitAdvanceInterruptibly() 1092 long nanos; field in Phaser.QNode 1098 boolean timed, long nanos) { in QNode() argument 1102 this.nanos = nanos; in QNode() 1104 this.deadline = timed ? System.nanoTime() + nanos : 0L; in QNode() 1122 (nanos <= 0L || (nanos = deadline - System.nanoTime()) <= 0L)) { in isReleasable() 1132 LockSupport.parkNanos(this, nanos); in block()
|
D | SynchronousQueue.java | 200 abstract E transfer(E e, boolean timed, long nanos); in transfer() argument 338 E transfer(E e, boolean timed, long nanos) { in transfer() argument 366 if (timed && nanos <= 0L) { // can't wait in transfer() 372 long deadline = timed ? System.nanoTime() + nanos : 0L; in transfer() 378 (nanos = deadline - System.nanoTime()) <= 0) || in transfer() 400 } else if (nanos > SPIN_FOR_TIMEOUT_THRESHOLD) in transfer() 401 LockSupport.parkNanos(this, nanos); in transfer() 629 E transfer(E e, boolean timed, long nanos) { in transfer() argument 666 else if (timed && nanos <= 0L) // can't wait in transfer() 671 long deadline = timed ? System.nanoTime() + nanos : 0L; in transfer() [all …]
|
D | SubmissionPublisher.java | 396 private int doOffer(T item, long nanos, in doOffer() argument 432 lag = retryOffer(item, nanos, onDrop, retries, lag, cleanMe); in doOffer() 447 private int retryOffer(T item, long nanos, in retryOffer() argument 454 if (nanos > 0L) in retryOffer() 455 r.awaitSpace(nanos); in retryOffer() 610 long nanos = unit.toNanos(timeout); in offer() local 612 if (nanos == Long.MAX_VALUE) --nanos; in offer() 613 return doOffer(item, nanos, onDrop); in offer() 1456 final void awaitSpace(long nanos) { in awaitSpace() argument 1460 timeout = nanos; in awaitSpace() [all …]
|
D | LinkedBlockingDeque.java | 403 long nanos = unit.toNanos(timeout); in offerFirst() local 408 if (nanos <= 0L) in offerFirst() 410 nanos = notFull.awaitNanos(nanos); in offerFirst() 426 long nanos = unit.toNanos(timeout); in offerLast() local 431 if (nanos <= 0L) in offerLast() 433 nanos = notFull.awaitNanos(nanos); in offerLast() 507 long nanos = unit.toNanos(timeout); in pollFirst() local 513 if (nanos <= 0L) in pollFirst() 515 nanos = notEmpty.awaitNanos(nanos); in pollFirst() 525 long nanos = unit.toNanos(timeout); in pollLast() local [all …]
|
D | FutureTask.java | 393 private int awaitDone(boolean timed, long nanos) in awaitDone() argument 421 if (timed && nanos <= 0L) in awaitDone() 433 parkNanos = nanos; in awaitDone() 436 if (elapsed >= nanos) { in awaitDone() 440 parkNanos = nanos - elapsed; in awaitDone()
|
D | ScheduledThreadPoolExecutor.java | 1205 long nanos = unit.toNanos(timeout); in poll() local 1212 if (nanos <= 0L) in poll() 1215 nanos = available.awaitNanos(nanos); in poll() 1220 if (nanos <= 0L) in poll() 1223 if (nanos < delay || leader != null) in poll() 1224 nanos = available.awaitNanos(nanos); in poll() 1230 nanos -= delay - timeLeft; in poll()
|
/libcore/ojluni/src/main/java/java/lang/ |
D | Thread.java | 359 private static native void sleep(Object lock, long millis, int nanos) in sleep() argument 385 public static void sleep(long millis, int nanos) in sleep() argument 401 if (nanos < 0) { in sleep() 402 throw new IllegalArgumentException("nanos < 0: " + nanos); in sleep() 404 if (nanos > 999999) { in sleep() 405 throw new IllegalArgumentException("nanos > 999999: " + nanos); in sleep() 421 if (millis == 0 && nanos == 0) { in sleep() 435 durationNanos = (millis * nanosPerMilli) + nanos; in sleep() 449 nanos = (int) (remaining % nanosPerMilli); in sleep() 450 sleep(lock, millis, nanos); in sleep() [all …]
|
/libcore/ojluni/src/main/java/sun/nio/ch/ |
D | SelChImpl.java | 84 default void park(int event, long nanos) throws IOException { in park() argument 86 if (nanos <= 0) { in park() 89 millis = NANOSECONDS.toMillis(nanos); in park()
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
D | TCKDuration.java | 1116 …public void plus(long seconds, int nanos, long otherSeconds, int otherNanos, long expectedSeconds,… in plus() argument 1117 …Duration t = Duration.ofSeconds(seconds, nanos).plus(Duration.ofSeconds(otherSeconds, otherNanos)); in plus() 1327 …public void plusSeconds_long(long seconds, int nanos, long amount, long expectedSeconds, int expec… in plusSeconds_long() argument 1328 Duration t = Duration.ofSeconds(seconds, nanos); in plusSeconds_long() 1403 …public void plusMillis_long(long seconds, int nanos, long amount, long expectedSeconds, int expect… in plusMillis_long() argument 1404 Duration t = Duration.ofSeconds(seconds, nanos); in plusMillis_long() 1410 …public void plusMillis_long_oneMore(long seconds, int nanos, long amount, long expectedSeconds, in… in plusMillis_long_oneMore() argument 1411 Duration t = Duration.ofSeconds(seconds + 1, nanos); in plusMillis_long_oneMore() 1417 …public void plusMillis_long_minusOneLess(long seconds, int nanos, long amount, long expectedSecond… in plusMillis_long_minusOneLess() argument 1418 Duration t = Duration.ofSeconds(seconds - 1, nanos); in plusMillis_long_minusOneLess() [all …]
|
D | TCKInstant.java | 697 …ic void test_plusTemporalAmount(TemporalUnit unit, TemporalAmount amount, int seconds, int nanos) { 700 Instant expected = Instant.ofEpochSecond(seconds, nanos); 921 …public void plus_Duration(long seconds, int nanos, long otherSeconds, int otherNanos, long expecte… 922 …Instant i = Instant.ofEpochSecond(seconds, nanos).plus(Duration.ofSeconds(otherSeconds, otherNanos… 941 …public void plus_longTemporalUnit(long seconds, int nanos, long otherSeconds, int otherNanos, long… 942 …Instant i = Instant.ofEpochSecond(seconds, nanos).plus(otherSeconds, SECONDS).plus(otherNanos, NAN… 991 …public void plusSeconds_long(long seconds, int nanos, long amount, long expectedSeconds, int expec… 992 Instant t = Instant.ofEpochSecond(seconds, nanos); 1070 …public void plusMillis_long(long seconds, int nanos, long amount, long expectedSeconds, int expect… 1071 Instant t = Instant.ofEpochSecond(seconds, nanos); [all …]
|
/libcore/ojluni/src/test/java/nio/file/attribute/ |
D | FileTimeTest.java | 170 long nanos = v; in main() local 171 ft = FileTime.from(nanos, NANOSECONDS); in main() 172 secs = nanos / 1000_000_000; in main() 173 nanos = nanos % 1000_000_000; in main() 174 instant = Instant.ofEpochSecond(secs, nanos); in main() 297 long nanos = NANOSECONDS.convert(value - unit.convert(secs, SECONDS), unit); in eqTime() local 298 if (nanos < 0) { // normalize nanoOfSecond to positive in eqTime() 300 nanos += 1000_000_000; in eqTime() 302 if (secs != instant.getEpochSecond() || (int)nanos != instant.getNano()) { in eqTime()
|
/libcore/ojluni/annotations/hiddenapi/java/time/ |
D | Duration.java | 73 private Duration(long seconds, int nanos) { in Duration() argument 101 public static java.time.Duration ofNanos(long nanos) { in ofNanos() argument 136 int nanos) { in create() argument 352 private final int nanos; field in Duration 355 nanos = 0;
|