Home
last modified time | relevance | path

Searched refs:MILLISECONDS (Results 1 – 25 of 35) sorted by relevance

12

/libcore/jsr166-tests/src/test/java/jsr166/
DThreadPoolExecutorTest.java13 import static java.util.concurrent.TimeUnit.MILLISECONDS;
25 super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>()); in ExtendedTPE()
62 LONG_DELAY_MS, MILLISECONDS, in testExecute()
71 assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); in testExecute()
84 LONG_DELAY_MS, MILLISECONDS, in testGetActiveCount()
96 assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS)); in testGetActiveCount()
110 LONG_DELAY_MS, MILLISECONDS, in testPrestartCoreThread()
128 LONG_DELAY_MS, MILLISECONDS, in testPrestartAllCoreThreads()
145 LONG_DELAY_MS, MILLISECONDS, in testGetCompletedTaskCount()
180 LONG_DELAY_MS, MILLISECONDS, in testGetCorePoolSize()
[all …]
DThreadPoolExecutorSubclassTest.java13 import static java.util.concurrent.TimeUnit.MILLISECONDS;
165 super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>()); in CustomTPE()
202 LONG_DELAY_MS, MILLISECONDS, in testExecute()
211 assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); in testExecute()
224 LONG_DELAY_MS, MILLISECONDS, in testGetActiveCount()
236 assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS)); in testGetActiveCount()
248 …ThreadPoolExecutor p = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Run… in testPrestartCoreThread()
263 …ThreadPoolExecutor p = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Run… in testPrestartAllCoreThreads()
279 LONG_DELAY_MS, MILLISECONDS, in testGetCompletedTaskCount()
312 …ThreadPoolExecutor p = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Run… in testGetCorePoolSize()
[all …]
DTimeUnitTest.java38 TimeUnit.MILLISECONDS)); in testConvert()
47 TimeUnit.MILLISECONDS.convert(t, in testConvert()
50 TimeUnit.MILLISECONDS.convert(t, in testConvert()
53 TimeUnit.MILLISECONDS.convert(t, in testConvert()
56 TimeUnit.MILLISECONDS.convert(t, in testConvert()
59 TimeUnit.MILLISECONDS.convert(t, in testConvert()
60 TimeUnit.MILLISECONDS)); in testConvert()
62 TimeUnit.MILLISECONDS.convert(1000L*t, in testConvert()
65 TimeUnit.MILLISECONDS.convert(1000000L*t, in testConvert()
82 TimeUnit.MILLISECONDS)); in testConvert()
[all …]
DScheduledExecutorTest.java14 import static java.util.concurrent.TimeUnit.MILLISECONDS;
31 assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); in testExecute()
51 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
54 assertTrue(done.await(0L, MILLISECONDS)); in testSchedule1()
73 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
75 assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); in testSchedule3()
97 LONG_DELAY_MS, MILLISECONDS); in testSchedule4()
121 LONG_DELAY_MS, MILLISECONDS); in testSchedule5()
142 p.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS); in testFixedRateSequence()
160 p.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS); in testFixedDelaySequence()
[all …]
DScheduledExecutorSubclassTest.java12 import static java.util.concurrent.TimeUnit.MILLISECONDS;
83 assertTrue(done.await(SMALL_DELAY_MS, MILLISECONDS)); in testExecute()
103 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
106 assertTrue(done.await(0L, MILLISECONDS)); in testSchedule1()
125 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
127 assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); in testSchedule3()
149 LONG_DELAY_MS, MILLISECONDS); in testSchedule4()
173 LONG_DELAY_MS, MILLISECONDS); in testSchedule5()
194 p.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS); in testFixedRateSequence()
212 p.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS); in testFixedDelaySequence()
[all …]
DExchangerTest.java16 import static java.util.concurrent.TimeUnit.MILLISECONDS;
47 assertSame(one, e.exchange(two, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
48 assertSame(two, e.exchange(one, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
52 assertSame(two, e.exchange(one, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
53 assertSame(one, e.exchange(two, LONG_DELAY_MS, MILLISECONDS)); in testTimedExchange()
86 e.exchange(null, LONG_DELAY_MS, MILLISECONDS); in testTimedExchange_InterruptedException()
103 e.exchange(null, timeoutMillis(), MILLISECONDS); in testExchange_TimeoutException()
DBlockingQueueTest.java19 import static java.util.concurrent.TimeUnit.MILLISECONDS;
83 q.offer(null, LONG_DELAY_MS, MILLISECONDS); in testTimedOfferNull()
210 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer()
215 assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer()
219 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
226 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
234 assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer()
294 q.poll(2 * LONG_DELAY_MS, MILLISECONDS);
316 q.poll(2 * LONG_DELAY_MS, MILLISECONDS);
DCountDownLatchTest.java14 import static java.util.concurrent.TimeUnit.MILLISECONDS;
86 assertTrue(l.await(LONG_DELAY_MS, MILLISECONDS)); in testTimedAwait()
141 l.await(LONG_DELAY_MS, MILLISECONDS); in testTimedAwait_Interruptible()
148 l.await(LONG_DELAY_MS, MILLISECONDS); in testTimedAwait_Interruptible()
170 assertFalse(l.await(timeoutMillis(), MILLISECONDS)); in testAwaitTimeout()
DLinkedBlockingDequeTest.java22 import static java.util.concurrent.TimeUnit.MILLISECONDS;
626 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
630 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer()
701 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0()
703 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
713 assertEquals(i, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll()
717 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
733 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll()
739 q.poll(MEDIUM_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
858 assertFalse(q.offerFirst(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOfferFirst()
[all …]
DAbstractExecutorServiceTest.java15 import static java.util.concurrent.TimeUnit.MILLISECONDS;
51 assertNull(future.get(0, MILLISECONDS)); in testExecuteRunnable()
391 e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny1()
421 e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny2()
439 e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny3()
455 e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny4()
473 String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAny5()
486 e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAll1()
516 …<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAll2()
532 e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS); in testTimedInvokeAll3()
[all …]
DForkJoinPoolTest.java29 import static java.util.concurrent.TimeUnit.MILLISECONDS;
231 assertFalse(p.awaitTermination(Long.MIN_VALUE, MILLISECONDS)); in testAwaitTermination_timesOut()
233 assertFalse(p.awaitTermination(-1L, MILLISECONDS)); in testAwaitTermination_timesOut()
235 assertFalse(p.awaitTermination(0L, MILLISECONDS)); in testAwaitTermination_timesOut()
243 assertFalse(p.awaitTermination(timeoutMillis, MILLISECONDS)); in testAwaitTermination_timesOut()
247 assertTrue(p.awaitTermination(LONG_DELAY_MS, MILLISECONDS)); in testAwaitTermination_timesOut()
270 assertTrue(uehInvoked.await(MEDIUM_DELAY_MS, MILLISECONDS)); in testSetUncaughtExceptionHandler()
423 assertNull(future.get(0, MILLISECONDS)); in testExecuteRunnable()
581 assertTrue(quittingTime.await(MEDIUM_DELAY_MS, MILLISECONDS)); in testInterruptedSubmit()
592 assertTrue(submitted.await(MEDIUM_DELAY_MS, MILLISECONDS)); in testInterruptedSubmit()
[all …]
DSynchronousQueueTest.java23 import static java.util.concurrent.TimeUnit.MILLISECONDS;
171 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
175 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer()
203 try { assertNull(q.poll(0, MILLISECONDS)); } in testTimedPoll0()
215 try { assertNull(q.poll(timeoutMillis(), MILLISECONDS)); } in testTimedPoll() local
233 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPollWithOffer()
238 assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollWithOffer()
243 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
250 q.poll(LONG_DELAY_MS, MILLISECONDS); in testTimedPollWithOffer()
258 try { assertTrue(q.offer(zero, LONG_DELAY_MS, MILLISECONDS)); } in testTimedPollWithOffer()
[all …]
DCyclicBarrierTest.java18 import static java.util.concurrent.TimeUnit.MILLISECONDS;
150 c.await(LONG_DELAY_MS, MILLISECONDS); in testAwait2_Interrupted_BrokenBarrier()
155 c.await(LONG_DELAY_MS, MILLISECONDS); in testAwait2_Interrupted_BrokenBarrier()
175 c.await(timeoutMillis(), MILLISECONDS); in testAwait3_TimeoutException()
193 c.await(LONG_DELAY_MS, MILLISECONDS); in testAwait4_Timeout_BrokenBarrier()
202 c.await(timeoutMillis(), MILLISECONDS); in testAwait4_Timeout_BrokenBarrier()
230 c.await(timeoutMillis(), MILLISECONDS); in testAwait5_Timeout_BrokenBarrier()
402 barrier.await(timeoutMillis(), MILLISECONDS); in testResetAfterTimeout()
DLinkedTransferQueueTest.java23 import static java.util.concurrent.TimeUnit.MILLISECONDS;
238 assertEquals(i, (int) q.poll(0, MILLISECONDS)); in testTimedPoll0()
240 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
251 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll()
255 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
271 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll()
277 q.poll(MEDIUM_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
302 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPollAfterInterrupt()
306 q.poll(MEDIUM_DELAY_MS, MILLISECONDS); in testTimedPollAfterInterrupt()
574 assertTrue(q.offer(one, LONG_DELAY_MS, MILLISECONDS)); in testOfferInExecutor()
[all …]
DDelayQueueTest.java23 import static java.util.concurrent.TimeUnit.MILLISECONDS;
314 assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS)); in testTimedOffer()
315 assertTrue(q.offer(new PDelay(0), LONG_DELAY_MS, MILLISECONDS)); in testTimedOffer()
381 assertEquals(new PDelay(i), ((PDelay)q.poll(0, MILLISECONDS))); in testTimedPoll0()
383 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
393 assertEquals(new PDelay(i), ((PDelay)q.poll(LONG_DELAY_MS, MILLISECONDS))); in testTimedPoll()
397 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
412 assertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, MILLISECONDS))); in testInterruptedTimedPoll()
417 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
424 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
[all …]
DExecutorsTest.java14 import static java.util.concurrent.TimeUnit.MILLISECONDS;
183 timeoutMillis(), MILLISECONDS); in testNewSingleThreadScheduledExecutor()
186 assertSame(Boolean.TRUE, f.get(LONG_DELAY_MS, MILLISECONDS)); in testNewSingleThreadScheduledExecutor()
209 timeoutMillis(), MILLISECONDS); in testNewScheduledThreadPool()
212 assertSame(Boolean.TRUE, f.get(LONG_DELAY_MS, MILLISECONDS)); in testNewScheduledThreadPool()
237 timeoutMillis(), MILLISECONDS); in testUnconfigurableScheduledExecutorService()
240 assertSame(Boolean.TRUE, f.get(LONG_DELAY_MS, MILLISECONDS)); in testUnconfigurableScheduledExecutorService()
DPriorityBlockingQueueTest.java24 import static java.util.concurrent.TimeUnit.MILLISECONDS;
280 assertTrue(q.offer(new Integer(0), SHORT_DELAY_MS, MILLISECONDS)); in testTimedOffer()
281 assertTrue(q.offer(new Integer(0), LONG_DELAY_MS, MILLISECONDS)); in testTimedOffer()
347 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0()
349 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
359 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll()
363 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
379 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll()
385 q.poll(LONG_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
607 assertSame(one, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testPollInExecutor()
DLinkedBlockingQueueTest.java23 import static java.util.concurrent.TimeUnit.MILLISECONDS;
316 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
320 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer()
391 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0()
393 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
403 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll()
407 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
423 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll()
429 q.poll(MEDIUM_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
694 assertTrue(q.offer(three, LONG_DELAY_MS, MILLISECONDS)); in testOfferInExecutor()
[all …]
DFutureTaskTest.java20 import static java.util.concurrent.TimeUnit.MILLISECONDS;
291 assertSame(one, task.get(LONG_DELAY_MS, MILLISECONDS)); in testSet()
316 task.get(LONG_DELAY_MS, MILLISECONDS); in testSetException_get()
546 assertSame(two, task.get(2*LONG_DELAY_MS, MILLISECONDS)); in testGetRun()
585 assertSame(two, task.get(2*LONG_DELAY_MS, MILLISECONDS)); in testGetSet()
638 task.get(2*LONG_DELAY_MS, MILLISECONDS); in testTimedGet_Cancellation()
694 task.get(LONG_DELAY_MS, MILLISECONDS); in testTimedGet_ExecutionException2()
742 task.get(2*LONG_DELAY_MS, MILLISECONDS); in testTimedGet_interruptible()
749 task.get(2*LONG_DELAY_MS, MILLISECONDS); in testTimedGet_interruptible()
768 task.get(timeoutMillis(), MILLISECONDS); in testGet_TimeoutException() local
DArrayBlockingQueueTest.java23 import static java.util.concurrent.TimeUnit.MILLISECONDS;
326 assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS)); in testTimedOffer()
330 q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS); in testTimedOffer()
401 assertEquals(i, q.poll(0, MILLISECONDS)); in testTimedPoll0()
403 assertNull(q.poll(0, MILLISECONDS)); in testTimedPoll0()
414 assertEquals(i, q.poll(LONG_DELAY_MS, MILLISECONDS)); in testTimedPoll()
418 assertNull(q.poll(timeoutMillis(), MILLISECONDS)); in testTimedPoll()
434 assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); in testInterruptedTimedPoll()
440 q.poll(MEDIUM_DELAY_MS, MILLISECONDS); in testInterruptedTimedPoll()
760 assertTrue(q.offer(three, LONG_DELAY_MS, MILLISECONDS)); in testOfferInExecutor()
[all …]
DPhaserTest.java16 import static java.util.concurrent.TimeUnit.MILLISECONDS;
474 phaser.awaitAdvanceInterruptibly(0, 2*LONG_DELAY_MS, MILLISECONDS);
481 phaser.awaitAdvanceInterruptibly(0, 2*LONG_DELAY_MS, MILLISECONDS);
681 assertEquals(-42, phaser.awaitAdvanceInterruptibly(-42, SMALL_DELAY_MS, MILLISECONDS));
689 assertEquals(-42, phaser.awaitAdvanceInterruptibly(-42, SMALL_DELAY_MS, MILLISECONDS));
692 assertEquals(1, phaser.awaitAdvanceInterruptibly(0, SMALL_DELAY_MS, MILLISECONDS));
700 assertEquals(-42, phaser.awaitAdvanceInterruptibly(-42, SMALL_DELAY_MS, MILLISECONDS));
703 assertEquals(2, phaser.awaitAdvanceInterruptibly(0, SMALL_DELAY_MS, MILLISECONDS));
706 assertEquals(2, phaser.awaitAdvanceInterruptibly(1, SMALL_DELAY_MS, MILLISECONDS));
DLockSupportTest.java16 import static java.util.concurrent.TimeUnit.MILLISECONDS;
44 LockSupport.parkNanos(MILLISECONDS.toNanos(millis)); in parkNanos()
63 MILLISECONDS.toNanos(millis)); in parkNanosBlocker()
DJSR166TestCase.java27 import static java.util.concurrent.TimeUnit.MILLISECONDS;
389 exec.awaitTermination(2 * LONG_DELAY_MS, MILLISECONDS)); in joinPool()
454 future.get(timeoutMillis, MILLISECONDS); in assertFutureTimesOut()
802 assertTrue(latch.await(LONG_DELAY_MS, MILLISECONDS));
810 assertTrue(semaphore.tryAcquire(LONG_DELAY_MS, MILLISECONDS));
1045 return super.await(2 * LONG_DELAY_MS, MILLISECONDS);
1063 assertNull(q.poll(0, MILLISECONDS));
DSemaphoreTest.java15 import static java.util.concurrent.TimeUnit.MILLISECONDS;
120 assertTrue(s.tryAcquire(2 * LONG_DELAY_MS, MILLISECONDS)); in tryAcquireTimed()
125 assertTrue(s.tryAcquire(permits, 2 * LONG_DELAY_MS, MILLISECONDS)); in acquire()
190 try { assertFalse(s.tryAcquire(timeoutMillis(), MILLISECONDS)); } in testTryAcquire_timeout() local
203 try { assertFalse(s.tryAcquire(3, timeoutMillis(), MILLISECONDS)); } in testTryAcquireN_timeout()
590 assertFalse(s.tryAcquire(0L, MILLISECONDS));
591 assertFalse(s.tryAcquire(1, 0L, MILLISECONDS));
/libcore/luni/src/main/java/java/util/concurrent/
DExecutors.java62 0L, TimeUnit.MILLISECONDS, in newFixedThreadPool()
125 0L, TimeUnit.MILLISECONDS, in newFixedThreadPool()
146 0L, TimeUnit.MILLISECONDS, in newSingleThreadExecutor()
167 0L, TimeUnit.MILLISECONDS, in newSingleThreadExecutor()

12