Lines Matching refs:tasks

348      * when tasks complete
570 * getTaskCount increases, but doesn't overestimate, when tasks submitted
679 * getQueue returns the work queue, which contains queued tasks
690 FutureTask[] tasks = new FutureTask[5];
691 for (int i = 0; i < tasks.length; i++) {
699 tasks[i] = new FutureTask(task);
700 p.execute(tasks[i]);
704 assertFalse(q.contains(tasks[0]));
705 assertTrue(q.contains(tasks[tasks.length - 1]));
706 assertEquals(tasks.length - 1, q.size());
721 Runnable[] tasks = new Runnable[6];
723 for (int i = 0; i < tasks.length; i++) {
724 tasks[i] = new CheckedRunnable() {
729 p.execute(tasks[i]);
732 assertFalse(p.remove(tasks[0]));
733 assertTrue(q.contains(tasks[4]));
734 assertTrue(q.contains(tasks[3]));
735 assertTrue(p.remove(tasks[4]));
736 assertFalse(p.remove(tasks[4]));
737 assertFalse(q.contains(tasks[4]));
738 assertTrue(q.contains(tasks[3]));
739 assertTrue(p.remove(tasks[3]));
740 assertFalse(q.contains(tasks[3]));
745 * purge removes cancelled tasks from the queue
756 FutureTask[] tasks = new FutureTask[5];
757 for (int i = 0; i < tasks.length; i++) {
764 tasks[i] = new FutureTask(task);
765 p.execute(tasks[i]);
768 assertEquals(tasks.length, p.getTaskCount());
769 assertEquals(tasks.length - 1, q.size());
772 tasks[4].cancel(true);
773 tasks[3].cancel(false);
775 assertEquals(tasks.length - 3, q.size());
776 assertEquals(tasks.length - 2, p.getTaskCount());
778 assertEquals(tasks.length - 3, q.size());
779 assertEquals(tasks.length - 2, p.getTaskCount());
784 * shutdownNow returns a list containing tasks that were not run,
785 * and those tasks are drained from the queue
1161 * Submitted tasks are rejected when saturated or shutdown
1212 done.countDown(); // release blocking tasks
1270 * Submitting null tasks throws NullPointerException
1588 * invokeAll(c) returns results of all completed tasks
1814 * timed invokeAll(c) returns results of all completed tasks
1834 * timed invokeAll(c) cancels tasks not completed by timeout
1849 List<Callable<String>> tasks = new ArrayList<>();
1850 tasks.add(new StringTask("0"));
1851 tasks.add(waiter);
1852 tasks.add(new StringTask("2"));
1855 p.invokeAll(tasks, timeout, MILLISECONDS);
1856 assertEquals(tasks.size(), futures.size());