Home
last modified time | relevance | path

Searched refs:timeoutMillis (Results 1 – 25 of 26) sorted by relevance

12

/libcore/luni/src/main/java/java/lang/ref/
DReferenceQueue.java88 public synchronized Reference<? extends T> remove(long timeoutMillis) in remove() argument
90 if (timeoutMillis < 0) { in remove()
91 throw new IllegalArgumentException("timeout < 0: " + timeoutMillis); in remove()
99 if (timeoutMillis == 0 || (timeoutMillis > Long.MAX_VALUE / NANOS_PER_MILLI)) { in remove()
107 long nanosToWait = timeoutMillis * NANOS_PER_MILLI; in remove()
113 wait(timeoutMillis, timeoutNanos); in remove()
122 timeoutMillis = nanosRemaining / NANOS_PER_MILLI; in remove()
123 timeoutNanos = (int) (nanosRemaining - timeoutMillis * NANOS_PER_MILLI); in remove()
/libcore/jsr166-tests/src/test/java/jsr166/
DCyclicBarrierTest.java175 c.await(timeoutMillis(), MILLISECONDS); in testAwait3_TimeoutException()
178 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testAwait3_TimeoutException()
202 c.await(timeoutMillis(), MILLISECONDS); in testAwait4_Timeout_BrokenBarrier()
205 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testAwait4_Timeout_BrokenBarrier()
230 c.await(timeoutMillis(), MILLISECONDS); in testAwait5_Timeout_BrokenBarrier()
233 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testAwait5_Timeout_BrokenBarrier()
311 delay(timeoutMillis()); in testReset_Leakage()
402 barrier.await(timeoutMillis(), MILLISECONDS); in testResetAfterTimeout()
405 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testResetAfterTimeout()
DJSR166TestCase.java142 long timeoutMillis() { in timeoutMillis() method in JSR166TestCase
402 assertThreadStaysAlive(thread, timeoutMillis()); in assertThreadStaysAlive()
423 assertThreadsStayAlive(timeoutMillis(), threads); in assertThreadsStayAlive()
445 assertFutureTimesOut(future, timeoutMillis()); in assertFutureTimesOut()
451 void assertFutureTimesOut(Future future, long timeoutMillis) { in assertFutureTimesOut() argument
454 future.get(timeoutMillis, MILLISECONDS); in assertFutureTimesOut()
460 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in assertFutureTimesOut()
597 void waitForThreadToEnterWaitState(Thread thread, long timeoutMillis) { in waitForThreadToEnterWaitState() argument
607 else if (millisElapsedSince(startTime) > timeoutMillis) { in waitForThreadToEnterWaitState()
647 void awaitTermination(Thread t, long timeoutMillis) { in awaitTermination() argument
[all …]
DReentrantLockTest.java143 long timeoutMillis = 2 * LONG_DELAY_MS; in await() local
149 assertTrue(c.await(timeoutMillis, MILLISECONDS)); in await()
152 long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); in await()
157 assertTrue(c.awaitUntil(delayedDate(timeoutMillis))); in await()
393 long timeoutMillis = 10; in testTryLock_Timeout()
394 assertFalse(lock.tryLock(timeoutMillis, MILLISECONDS)); in testTryLock_Timeout()
395 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in testTryLock_Timeout()
522 long timeoutMillis = 10;
523 long timeoutNanos = MILLISECONDS.toNanos(timeoutMillis);
526 assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
[all …]
DExecutorsTest.java183 timeoutMillis(), MILLISECONDS); in testNewSingleThreadScheduledExecutor()
190 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testNewSingleThreadScheduledExecutor()
209 timeoutMillis(), MILLISECONDS); in testNewScheduledThreadPool()
216 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testNewScheduledThreadPool()
237 timeoutMillis(), MILLISECONDS); in testUnconfigurableScheduledExecutorService()
244 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testUnconfigurableScheduledExecutorService()
DAbstractQueuedLongSynchronizerTest.java201 long timeoutMillis = 2 * LONG_DELAY_MS; in await() local
207 assertTrue(c.await(timeoutMillis, MILLISECONDS)); in await()
210 long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); in await()
215 assertTrue(c.awaitUntil(delayedDate(timeoutMillis))); in await()
225 long timeoutMillis = timeoutMillis(); in assertAwaitTimesOut() local
230 assertFalse(c.await(timeoutMillis, MILLISECONDS)); in assertAwaitTimesOut()
233 long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); in assertAwaitTimesOut()
238 assertFalse(c.awaitUntil(delayedDate(timeoutMillis))); in assertAwaitTimesOut()
244 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in assertAwaitTimesOut()
524 long nanos = MILLISECONDS.toNanos(timeoutMillis()); in testAcquireNanos_Timeout()
[all …]
DAbstractQueuedSynchronizerTest.java204 long timeoutMillis = 2 * LONG_DELAY_MS; in await() local
210 assertTrue(c.await(timeoutMillis, MILLISECONDS)); in await()
213 long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); in await()
218 assertTrue(c.awaitUntil(delayedDate(timeoutMillis))); in await()
228 long timeoutMillis = timeoutMillis(); in assertAwaitTimesOut() local
233 assertFalse(c.await(timeoutMillis, MILLISECONDS)); in assertAwaitTimesOut()
236 long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); in assertAwaitTimesOut()
241 assertFalse(c.awaitUntil(delayedDate(timeoutMillis))); in assertAwaitTimesOut()
247 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in assertAwaitTimesOut()
527 long nanos = MILLISECONDS.toNanos(timeoutMillis()); in testAcquireNanos_Timeout()
[all …]
DScheduledExecutorTest.java48 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule1()
51 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
53 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule1()
71 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule3()
73 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
76 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule3()
93 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule4()
96 p.scheduleAtFixedRate(task, timeoutMillis(), in testSchedule4()
99 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule4()
117 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule5()
[all …]
DExchangerTest.java103 e.exchange(null, timeoutMillis(), MILLISECONDS); in testExchange_TimeoutException()
106 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testExchange_TimeoutException()
DSynchronousQueueTest.java171 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
172 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedOffer()
215 try { assertNull(q.poll(timeoutMillis(), MILLISECONDS)); } in testTimedPoll()
217 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
233 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer()
234 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPollWithOffer()
DScheduledExecutorSubclassTest.java100 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule1()
103 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
105 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule1()
123 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule3()
125 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
128 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule3()
145 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule4()
148 p.scheduleAtFixedRate(task, timeoutMillis(), in testSchedule4()
151 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule4()
169 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testSchedule5()
[all …]
DLinkedBlockingDequeTest.java626 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
627 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedOffer()
717 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
718 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
858 assertFalse(q.offerFirst(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOfferFirst()
859 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedOfferFirst()
1020 assertNull(q.pollFirst(timeoutMillis(), MILLISECONDS)); in testTimedPollFirst()
1021 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPollFirst()
1069 assertNull(q.pollFirst(timeoutMillis(), MILLISECONDS)); in testTimedPollFirstWithOfferFirst()
1070 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPollFirstWithOfferFirst()
[all …]
DReentrantReadWriteLockTest.java781 long timeoutMillis = 10; in testWriteTryLock_Timeout()
782 assertFalse(lock.writeLock().tryLock(timeoutMillis, MILLISECONDS)); in testWriteTryLock_Timeout()
783 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in testWriteTryLock_Timeout()
801 long timeoutMillis = 10; in testReadTryLock_Timeout()
802 assertFalse(lock.readLock().tryLock(timeoutMillis, MILLISECONDS)); in testReadTryLock_Timeout()
803 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in testReadTryLock_Timeout()
921 long timeoutMillis = 10;
922 long timeoutNanos = MILLISECONDS.toNanos(timeoutMillis);
925 assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
944 long timeoutMillis = 10;
[all …]
DLockSupportTest.java247 parkMethod.park(timeoutMillis()); in testParkTimesOut()
249 if (millisElapsedSince(startTime) >= timeoutMillis()) in testParkTimesOut()
DBlockingQueueTest.java210 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer()
211 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPollWithOffer()
DSemaphoreTest.java190 try { assertFalse(s.tryAcquire(timeoutMillis(), MILLISECONDS)); } in testTryAcquire_timeout()
192 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTryAcquire_timeout()
203 try { assertFalse(s.tryAcquire(3, timeoutMillis(), MILLISECONDS)); } in testTryAcquireN_timeout()
205 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTryAcquireN_timeout()
DLinkedTransferQueueTest.java255 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
256 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
947 timeoutMillis(), MILLISECONDS)); in testTryTransfer6()
948 assertTrue(millisElapsedSince(t0) >= timeoutMillis()); in testTryTransfer6()
988 assertFalse(q.tryTransfer(five, timeoutMillis(), MILLISECONDS)); in testTryTransfer8()
989 assertTrue(millisElapsedSince(t0) >= timeoutMillis()); in testTryTransfer8()
DCountDownLatchTest.java170 assertFalse(l.await(timeoutMillis(), MILLISECONDS)); in testAwaitTimeout()
DLinkedBlockingQueueTest.java316 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
317 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedOffer()
407 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
408 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
DArrayBlockingQueueTest.java326 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
327 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedOffer()
418 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
419 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
DForkJoinPoolTest.java242 long timeoutMillis = timeoutMillis(); in testAwaitTermination_timesOut() local
243 assertFalse(p.awaitTermination(timeoutMillis, MILLISECONDS)); in testAwaitTermination_timesOut()
244 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in testAwaitTermination_timesOut()
DDelayQueueTest.java397 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
398 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
703 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollDelayed()
DPriorityBlockingQueueTest.java363 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
364 assertTrue(millisElapsedSince(startTime) >= timeoutMillis()); in testTimedPoll()
DThreadPoolExecutorTest.java421 long timeoutMillis = timeoutMillis(); in testAwaitTermination_timesOut() local
422 assertFalse(p.awaitTermination(timeoutMillis, MILLISECONDS)); in testAwaitTermination_timesOut()
423 assertTrue(millisElapsedSince(startTime) >= timeoutMillis); in testAwaitTermination_timesOut()
/libcore/luni/src/main/java/java/net/
DURLConnection.java966 public void setConnectTimeout(int timeoutMillis) { in setConnectTimeout() argument
967 if (timeoutMillis < 0) { in setConnectTimeout()
970 this.connectTimeout = timeoutMillis; in setConnectTimeout()
988 public void setReadTimeout(int timeoutMillis) { in setReadTimeout() argument
989 if (timeoutMillis < 0) { in setReadTimeout()
992 this.readTimeout = timeoutMillis; in setReadTimeout()

12