Home
last modified time | relevance | path

Searched refs:tasks (Results 1 – 13 of 13) sorted by relevance

/libcore/luni/src/main/java/java/util/concurrent/
DAbstractExecutorService.java110 private <T> T doInvokeAny(Collection<? extends Callable<T>> tasks, in doInvokeAny() argument
113 if (tasks == null) in doInvokeAny()
115 int ntasks = tasks.size(); in doInvokeAny()
133 Iterator<? extends Callable<T>> it = tasks.iterator(); in doInvokeAny()
181 public <T> T invokeAny(Collection<? extends Callable<T>> tasks) in invokeAny() argument
184 return doInvokeAny(tasks, false, 0); in invokeAny()
191 public <T> T invokeAny(Collection<? extends Callable<T>> tasks, in invokeAny() argument
194 return doInvokeAny(tasks, true, unit.toNanos(timeout)); in invokeAny()
197 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) in invokeAll() argument
199 if (tasks == null) in invokeAll()
[all …]
DExecutorService.java244 <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) in invokeAll() argument
274 <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, in invokeAll() argument
296 <T> T invokeAny(Collection<? extends Callable<T>> tasks) in invokeAny() argument
321 <T> T invokeAny(Collection<? extends Callable<T>> tasks, in invokeAny() argument
DExecutors.java601 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
603 return e.invokeAll(tasks);
605 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
608 return e.invokeAll(tasks, timeout, unit);
610 public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
612 return e.invokeAny(tasks);
614 public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
617 return e.invokeAny(tasks, timeout, unit);
DForkJoinTask.java740 public static void invokeAll(ForkJoinTask<?>... tasks) { in invokeAll() argument
742 int last = tasks.length - 1; in invokeAll()
744 ForkJoinTask<?> t = tasks[i]; in invokeAll()
755 ForkJoinTask<?> t = tasks[i]; in invokeAll()
784 public static <T extends ForkJoinTask<?>> Collection<T> invokeAll(Collection<T> tasks) { in invokeAll() argument
785 if (!(tasks instanceof RandomAccess) || !(tasks instanceof List<?>)) { in invokeAll()
786 invokeAll(tasks.toArray(new ForkJoinTask<?>[tasks.size()])); in invokeAll()
787 return tasks; in invokeAll()
791 (List<? extends ForkJoinTask<?>>) tasks; in invokeAll()
816 return tasks; in invokeAll()
DThreadPoolExecutor.java1381 List<Runnable> tasks; in shutdownNow() local
1388 tasks = drainQueue(); in shutdownNow()
1393 return tasks; in shutdownNow()
DForkJoinPool.java2583 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) { in invokeAll() argument
2587 ArrayList<Future<T>> futures = new ArrayList<Future<T>>(tasks.size()); in invokeAll()
2591 for (Callable<T> t : tasks) { in invokeAll()
/libcore/luni/src/main/java/java/util/
DTimer.java181 private TimerHeap tasks = new TimerHeap(); field in Timer.TimerImpl
208 if (tasks.isEmpty()) { in run()
222 task = tasks.minimum(); in run()
227 tasks.delete(0); in run()
248 if (tasks.minimum().when != task.when) { in run()
249 pos = tasks.getTask(task); in run()
252 tasks.delete(tasks.getTask(task)); in run()
260 tasks.delete(pos); in run()
298 tasks.insert(newTask); in insertTask()
307 tasks.reset(); in cancel()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DScheduledExecutorTest.java528 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testGetQueue() local
529 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
535 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testGetQueue()
539 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
540 assertFalse(q.contains(tasks[0])); in testGetQueue()
552 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testRemove() local
556 for (int i = 0; i < tasks.length; i++) { in testRemove()
562 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testRemove()
566 assertFalse(p.remove((Runnable)tasks[0])); in testRemove()
567 assertTrue(q.contains((Runnable)tasks[4])); in testRemove()
[all …]
DThreadPoolExecutorTest.java499 FutureTask[] tasks = new FutureTask[5]; in testGetQueue() local
500 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
508 tasks[i] = new FutureTask(task); in testGetQueue()
509 p.execute(tasks[i]); in testGetQueue()
513 assertFalse(q.contains(tasks[0])); in testGetQueue()
514 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
515 assertEquals(tasks.length - 1, q.size()); in testGetQueue()
531 Runnable[] tasks = new Runnable[5]; in testRemove() local
535 for (int i = 0; i < tasks.length; i++) { in testRemove()
536 tasks[i] = new CheckedRunnable() { in testRemove()
[all …]
DScheduledExecutorSubclassTest.java577 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testGetQueue() local
578 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
584 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testGetQueue()
588 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
589 assertFalse(q.contains(tasks[0])); in testGetQueue()
601 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testRemove() local
605 for (int i = 0; i < tasks.length; i++) { in testRemove()
611 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testRemove()
615 assertFalse(p.remove((Runnable)tasks[0])); in testRemove()
616 assertTrue(q.contains((Runnable)tasks[4])); in testRemove()
[all …]
DThreadPoolExecutorSubclassTest.java572 FutureTask[] tasks = new FutureTask[5]; in testGetQueue() local
573 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
581 tasks[i] = new FutureTask(task); in testGetQueue()
582 p.execute(tasks[i]); in testGetQueue()
586 assertFalse(q.contains(tasks[0])); in testGetQueue()
587 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
588 assertEquals(tasks.length - 1, q.size()); in testGetQueue()
604 Runnable[] tasks = new Runnable[6]; in testRemove() local
608 for (int i = 0; i < tasks.length; i++) { in testRemove()
609 tasks[i] = new CheckedRunnable() { in testRemove()
[all …]
/libcore/dalvik/src/main/java/dalvik/system/
DZygoteHooks.java70 File tasks = new File("/proc/self/task"); in waitUntilAllThreadsStopped() local
71 while (tasks.list().length > 1) { in waitUntilAllThreadsStopped()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DTimerTest.java277 TimerTestTask[] tasks = new TimerTestTask[100]; in test_purge() local
282 tasks[i] = new TimerTestTask(); in test_purge()
283 t.schedule(tasks[i], delayTime[j++], 200); in test_purge()
290 tasks[i].cancel(); in test_purge()