Home
last modified time | relevance | path

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

12

/libcore/ojluni/src/main/java/java/util/concurrent/
DAbstractExecutorService.java152 private <T> T doInvokeAny(Collection<? extends Callable<T>> tasks, in doInvokeAny() argument
155 if (tasks == null) in doInvokeAny()
157 int ntasks = tasks.size(); in doInvokeAny()
175 Iterator<? extends Callable<T>> it = tasks.iterator(); in doInvokeAny()
222 public <T> T invokeAny(Collection<? extends Callable<T>> tasks) in invokeAny() argument
225 return doInvokeAny(tasks, false, 0); in invokeAny()
232 public <T> T invokeAny(Collection<? extends Callable<T>> tasks, in invokeAny() argument
235 return doInvokeAny(tasks, true, unit.toNanos(timeout)); in invokeAny()
238 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) in invokeAll() argument
240 if (tasks == null) in invokeAll()
[all …]
DExecutorService.java277 <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) in invokeAll() argument
308 <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, in invokeAll() argument
331 <T> T invokeAny(Collection<? extends Callable<T>> tasks) in invokeAny() argument
357 <T> T invokeAny(Collection<? extends Callable<T>> tasks, in invokeAny() argument
DExecutors.java718 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
721 return e.invokeAll(tasks);
724 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
728 return e.invokeAll(tasks, timeout, unit);
731 public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
734 return e.invokeAny(tasks);
737 public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
741 return e.invokeAny(tasks, timeout, unit);
DForkJoinTask.java744 public static void invokeAll(ForkJoinTask<?>... tasks) { in invokeAll() argument
746 int last = tasks.length - 1; in invokeAll()
749 if ((t = tasks[i]) == null) { in invokeAll()
766 if ((t = tasks[i]) != null) { in invokeAll()
777 cancelIgnoringExceptions(tasks[i]); in invokeAll()
800 public static <T extends ForkJoinTask<?>> Collection<T> invokeAll(Collection<T> tasks) { in invokeAll() argument
801 if (!(tasks instanceof RandomAccess) || !(tasks instanceof List<?>)) { in invokeAll()
802 invokeAll(tasks.toArray(new ForkJoinTask<?>[0])); in invokeAll()
803 return tasks; in invokeAll()
807 (List<? extends ForkJoinTask<?>>) tasks; in invokeAll()
[all …]
DForkJoinPool.java2724 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) {
2725 ArrayList<Future<T>> futures = new ArrayList<>(tasks.size());
2727 for (Callable<T> t : tasks) {
2744 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
2748 ArrayList<Future<T>> futures = new ArrayList<>(tasks.size());
2750 for (Callable<T> t : tasks) {
2850 public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
2852 int n = tasks.size();
2858 for (Callable<T> c : tasks) {
2875 public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
[all …]
DThreadPoolExecutor.java1418 List<Runnable> tasks; in shutdownNow() local
1425 tasks = drainQueue(); in shutdownNow()
1430 return tasks; in shutdownNow()
/libcore/ojluni/src/test/java/lang/constant/
DDynamicConstantDescTest.java64 final List<Callable<?>> tasks = new ArrayList<>(); in main() local
67 tasks.add(new Task("java.lang.constant.DynamicConstantDesc", taskTriggerLatch)); in main()
68 tasks.add(new InvokeOfCanonical(taskTriggerLatch)); in main()
69 tasks.add(new Task("java.lang.constant.ConstantDescs", taskTriggerLatch)); in main()
70 tasks.add(new InvokeOfCanonical(taskTriggerLatch)); in main()
71 final ExecutorService executor = Executors.newFixedThreadPool(tasks.size()); in main()
73 final Future<?>[] results = new Future[tasks.size()]; in main()
76 for (final Callable<?> task : tasks) { in main()
80 for (i = 0; i < tasks.size(); i++) { in main()
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadPoolExecutorTest.java552 FutureTask[] tasks = new FutureTask[5]; in testGetQueue() local
553 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
561 tasks[i] = new FutureTask(task); in testGetQueue()
562 p.execute(tasks[i]); in testGetQueue()
566 assertFalse(q.contains(tasks[0])); in testGetQueue()
567 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
568 assertEquals(tasks.length - 1, q.size()); in testGetQueue()
583 Runnable[] tasks = new Runnable[6]; in testRemove() local
585 for (int i = 0; i < tasks.length; i++) { in testRemove()
586 tasks[i] = new CheckedRunnable() { in testRemove()
[all …]
DThreadPoolExecutorSubclassTest.java667 FutureTask[] tasks = new FutureTask[5]; in testGetQueue() local
668 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
676 tasks[i] = new FutureTask(task); in testGetQueue()
677 p.execute(tasks[i]); in testGetQueue()
681 assertFalse(q.contains(tasks[0])); in testGetQueue()
682 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
683 assertEquals(tasks.length - 1, q.size()); in testGetQueue()
698 Runnable[] tasks = new Runnable[6]; in testRemove() local
700 for (int i = 0; i < tasks.length; i++) { in testRemove()
701 tasks[i] = new CheckedRunnable() { in testRemove()
[all …]
DScheduledExecutorSubclassTest.java639 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testGetQueue() local
640 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
646 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testGetQueue()
650 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
651 assertFalse(q.contains(tasks[0])); in testGetQueue()
662 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testRemove() local
664 for (int i = 0; i < tasks.length; i++) { in testRemove()
670 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testRemove()
674 assertFalse(p.remove((Runnable)tasks[0])); in testRemove()
675 assertTrue(q.contains((Runnable)tasks[4])); in testRemove()
[all …]
DScheduledExecutorTest.java587 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testGetQueue() local
588 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
594 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testGetQueue()
598 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
599 assertFalse(q.contains(tasks[0])); in testGetQueue()
610 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testRemove() local
612 for (int i = 0; i < tasks.length; i++) { in testRemove()
618 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testRemove()
622 assertFalse(p.remove((Runnable)tasks[0])); in testRemove()
623 assertTrue(q.contains((Runnable)tasks[4])); in testRemove()
[all …]
DForkJoinTask8Test.java806 AsyncFib[] tasks = {
810 invokeAll(tasks[0], tasks[1]);
811 for (AsyncFib task : tasks) assertTrue(task.isDone());
812 for (AsyncFib task : tasks) task.checkCompletedNormally();
829 AsyncFib[] tasks = {
834 invokeAll(tasks[0], tasks[1], tasks[2]);
835 for (AsyncFib task : tasks) assertTrue(task.isDone());
836 for (AsyncFib task : tasks) task.checkCompletedNormally();
853 AsyncFib[] tasks = {
858 invokeAll(Arrays.asList(tasks));
[all …]
DForkJoinTaskTest.java903 ForkJoinTask[] tasks = { f, g };
904 Collections.shuffle(Arrays.asList(tasks));
906 invokeAll(tasks);
941 ForkJoinTask[] tasks = { f, g, h };
942 Collections.shuffle(Arrays.asList(tasks));
944 invokeAll(tasks);
962 ForkJoinTask[] tasks = { f, g, h };
963 List taskList = Arrays.asList(tasks);
1573 ForkJoinTask[] tasks = { f, g };
1574 Collections.shuffle(Arrays.asList(tasks));
[all …]
DAbstractExecutorServiceTest.java585 List<Callable<String>> tasks = new ArrayList<>();
586 tasks.add(new StringTask("0"));
587 tasks.add(Executors.callable(possiblyInterruptedRunnable(timeout),
589 tasks.add(new StringTask("2"));
592 e.invokeAll(tasks, timeout, MILLISECONDS);
593 assertEquals(tasks.size(), futures.size());
/libcore/ojluni/src/test/java/util/concurrent/tck/
DThreadPoolExecutorTest.java574 FutureTask[] tasks = new FutureTask[5]; in testGetQueue() local
575 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
583 tasks[i] = new FutureTask(task); in testGetQueue()
584 p.execute(tasks[i]); in testGetQueue()
588 assertFalse(q.contains(tasks[0])); in testGetQueue()
589 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
590 assertEquals(tasks.length - 1, q.size()); in testGetQueue()
605 Runnable[] tasks = new Runnable[6]; in testRemove() local
607 for (int i = 0; i < tasks.length; i++) { in testRemove()
608 tasks[i] = new CheckedRunnable() { in testRemove()
[all …]
DThreadPoolExecutorSubclassTest.java689 FutureTask[] tasks = new FutureTask[5]; in testGetQueue() local
690 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
698 tasks[i] = new FutureTask(task); in testGetQueue()
699 p.execute(tasks[i]); in testGetQueue()
703 assertFalse(q.contains(tasks[0])); in testGetQueue()
704 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
705 assertEquals(tasks.length - 1, q.size()); in testGetQueue()
720 Runnable[] tasks = new Runnable[6]; in testRemove() local
722 for (int i = 0; i < tasks.length; i++) { in testRemove()
723 tasks[i] = new CheckedRunnable() { in testRemove()
[all …]
DScheduledExecutorSubclassTest.java663 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testGetQueue() local
664 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
670 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testGetQueue()
674 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
675 assertFalse(q.contains(tasks[0])); in testGetQueue()
686 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testRemove() local
688 for (int i = 0; i < tasks.length; i++) { in testRemove()
694 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testRemove()
698 assertFalse(p.remove((Runnable)tasks[0])); in testRemove()
699 assertTrue(q.contains((Runnable)tasks[4])); in testRemove()
[all …]
DScheduledExecutorTest.java610 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testGetQueue() local
611 for (int i = 0; i < tasks.length; i++) { in testGetQueue()
617 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testGetQueue()
621 assertTrue(q.contains(tasks[tasks.length - 1])); in testGetQueue()
622 assertFalse(q.contains(tasks[0])); in testGetQueue()
633 ScheduledFuture[] tasks = new ScheduledFuture[5]; in testRemove() local
635 for (int i = 0; i < tasks.length; i++) { in testRemove()
641 tasks[i] = p.schedule(r, 1, MILLISECONDS); in testRemove()
645 assertFalse(p.remove((Runnable)tasks[0])); in testRemove()
646 assertTrue(q.contains((Runnable)tasks[4])); in testRemove()
[all …]
DForkJoinTask8Test.java829 AsyncFib[] tasks = {
833 invokeAll(tasks[0], tasks[1]);
834 for (AsyncFib task : tasks) assertTrue(task.isDone());
835 for (AsyncFib task : tasks) task.checkCompletedNormally();
852 AsyncFib[] tasks = {
857 invokeAll(tasks[0], tasks[1], tasks[2]);
858 for (AsyncFib task : tasks) assertTrue(task.isDone());
859 for (AsyncFib task : tasks) task.checkCompletedNormally();
876 AsyncFib[] tasks = {
881 invokeAll(Arrays.asList(tasks));
[all …]
DForkJoinTaskTest.java925 ForkJoinTask[] tasks = { f, g };
926 shuffle(tasks);
928 invokeAll(tasks);
963 ForkJoinTask[] tasks = { f, g, h };
964 shuffle(tasks);
966 invokeAll(tasks);
984 ForkJoinTask[] tasks = { f, g, h };
985 shuffle(tasks);
987 invokeAll(Arrays.asList(tasks));
1594 ForkJoinTask[] tasks = { f, g };
[all …]
DAbstractExecutorServiceTest.java608 List<Callable<String>> tasks = new ArrayList<>();
609 tasks.add(new StringTask("0"));
610 tasks.add(Executors.callable(possiblyInterruptedRunnable(timeout),
612 tasks.add(new StringTask("2"));
615 e.invokeAll(tasks, timeout, MILLISECONDS);
616 assertEquals(tasks.size(), futures.size());
/libcore/ojluni/src/test/java/util/Random/
DRandomStreamTest.java150 final int tasks = 10; in testRandomResultSupplierConcurrently() local
152 limit(tasks).collect(toList()); in testRandomResultSupplierConcurrently()
162 assertEquals(rc, tasks); in testRandomResultSupplierConcurrently()
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/
DExecutors.java231 java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) in invokeAll() argument
237 java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, in invokeAll() argument
245 java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) in invokeAny() argument
251 java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, in invokeAny() argument
/libcore/
DNativeCode.bp231 // platform_testing/build/tasks/tests/native_test_list.mk.
258 // platform_testing/build/tasks/tests/native_metric_test_list.mk.
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DTimerTest.java281 TimerTestTask[] tasks = new TimerTestTask[100]; in test_purge() local
286 tasks[i] = new TimerTestTask(); in test_purge()
287 t.schedule(tasks[i], delayTime[j++], 200); in test_purge()
294 tasks[i].cancel(); in test_purge()

12