Searched refs:Future (Results 1 - 25 of 36) sorted by relevance

12

/libcore/luni/src/main/java/java/util/concurrent/
H A DCompletionService.java34 * Submits a value-returning task for execution and returns a Future
39 * @return a Future representing pending completion of the task
44 Future<V> submit(Callable<V> task);
47 * Submits a Runnable task for execution and returns a Future
53 * @return a Future representing pending completion of the task,
60 Future<V> submit(Runnable task, V result);
63 * Retrieves and removes the Future representing the next
66 * @return the Future representing the next completed task
69 Future<V> take() throws InterruptedException;
72 * Retrieves and removes the Future representin
[all...]
H A DScheduledFuture.java16 * @param <V> The result type returned by this Future
18 public interface ScheduledFuture<V> extends Delayed, Future<V> {
H A DRunnableFuture.java10 * A {@link Future} that is {@link Runnable}. Successful execution of
11 * the {@code run} method causes completion of the {@code Future}
17 * @param <V> The result type returned by this Future's {@code get} method
19 public interface RunnableFuture<V> extends Runnable, Future<V> {
21 * Sets this Future to the result of its computation
H A DExecutorCompletionService.java53 * List<Future<Result>> futures = new ArrayList<>(n);
69 * for (Future<Result> f : futures)
80 private final BlockingQueue<Future<V>> completionQueue;
87 BlockingQueue<Future<V>> completionQueue) {
92 private final Future<V> task;
93 private final BlockingQueue<Future<V>> completionQueue;
125 this.completionQueue = new LinkedBlockingQueue<Future<V>>();
142 BlockingQueue<Future<V>> completionQueue) {
151 public Future<V> submit(Callable<V> task) {
158 public Future<
[all...]
H A DExecutorService.java18 * methods that can produce a {@link Future} for tracking progress of
33 * Executor#execute(Runnable)} by creating and returning a {@link Future}
108 * result is retrieved via {@code Future.get()}.
176 * Future representing the pending results of the task. The
177 * Future's {@code get} method will return the task's result upon
192 * @return a Future representing pending completion of the task
197 <T> Future<T> submit(Callable<T> task);
200 * Submits a Runnable task for execution and returns a Future
201 * representing that task. The Future's {@code get} method will
207 * @return a Future representin
[all...]
H A DFuture.java10 * A {@code Future} represents the result of an asynchronous
19 * If you would like to use a {@code Future} for the sake
21 * declare types of the form {@code Future<?>} and
35 * Future<String> future
47 * The {@link FutureTask} class is an implementation of {@code Future} that
60 * actions following the corresponding {@code Future.get()} in another thread.
66 * @param <V> The result type returned by this Future's {@code get} method
68 public interface Future<V> { interface
H A DAbstractExecutorService.java58 * underlying runnable and which, as a {@code Future}, will yield
73 * underlying callable and which, as a {@code Future}, will yield
86 public Future<?> submit(Runnable task) {
97 public <T> Future<T> submit(Runnable task, T result) {
108 public <T> Future<T> submit(Callable<T> task) {
126 ArrayList<Future<T>> futures = new ArrayList<>(ntasks);
149 Future<T> f = ecs.poll();
204 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
208 ArrayList<Future<T>> futures = new ArrayList<>(tasks.size());
216 Future<
[all...]
H A DExecutors.java600 public Future<?> submit(Runnable task) {
603 public <T> Future<T> submit(Callable<T> task) {
606 public <T> Future<T> submit(Runnable task, T result) {
609 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
613 public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
/libcore/jsr166-tests/src/test/java/jsr166/
H A DExecutorCompletionServiceTest.java18 import java.util.concurrent.Future;
99 Future f = ecs.take();
112 Future f1 = ecs.submit(c);
113 Future f2 = ecs.take();
130 Future f;
151 Future f = ecs.poll(SHORT_DELAY_MS, MILLISECONDS);
159 * returns and eventually runs Future returned by newTaskFor.
179 Future f1 = ecs.submit(c);
182 Future f2 = ecs.take();
190 * returns and eventually runs Future returne
[all...]
H A DAbstractExecutorServiceTest.java26 import java.util.concurrent.Future;
70 Future<?> future = e.submit(new CheckedRunnable() {
86 Future<String> future = e.submit(new StringTask());
96 Future<?> future = e.submit(new NoOpRunnable());
106 Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
118 Future future = e.submit(Executors.callable(new PrivilegedAction() {
139 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
157 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
211 Future<Void> future = p.submit(awaiter);
336 List<Future<Strin
[all...]
H A DForkJoinPoolTest.java25 import java.util.concurrent.Future;
232 Future<?> future = p.submit(task);
430 Future<?> future = e.submit(new CheckedRunnable() {
448 Future<String> future = e.submit(new StringTask());
461 Future<?> future = e.submit(new NoOpRunnable());
474 Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
491 Future future = e.submit(callable);
510 Future future = e.submit(callable);
529 Future future = e.submit(callable);
549 Future<
[all...]
H A DScheduledExecutorSubclassTest.java24 import java.util.concurrent.Future;
134 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS);
153 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS);
305 Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
826 List<Future<?>> blockers = new ArrayList<>();
827 List<Future<?>> periodics = new ArrayList<>();
828 List<Future<?>> delayeds = new ArrayList<>();
844 for (Future<?> periodic : periodics) {
848 for (Future<?> delayed : delayeds) {
861 for (Future<
[all...]
H A DScheduledExecutorTest.java25 import java.util.concurrent.Future;
77 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS);
97 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS);
249 Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
775 List<Future<?>> blockers = new ArrayList<>();
776 List<Future<?>> periodics = new ArrayList<>();
777 List<Future<?>> delayeds = new ArrayList<>();
793 for (Future<?> periodic : periodics) {
797 for (Future<?> delayed : delayeds) {
810 for (Future<
[all...]
H A DCollection8Test.java18 import java.util.concurrent.Future;
81 final Future<?> f1, f2;
H A DExecutorsTest.java24 import java.util.concurrent.Future;
211 Future f = p.schedule(Executors.callable(task, Boolean.TRUE),
235 Future f = p.schedule(Executors.callable(task, Boolean.TRUE),
261 Future f = p.schedule(Executors.callable(task, Boolean.TRUE),
274 * Future.get on submitted tasks will time out if they compute too long.
293 Future future = executor.submit(sleeper);
H A DThreadPoolExecutorSubclassTest.java24 import java.util.concurrent.Future;
1436 Future<String> future = e.submit(new StringTask());
1451 Future<?> future = e.submit(new NoOpRunnable());
1466 Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
1587 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
1622 List<Future<String>> futures = e.invokeAll(l);
1645 List<Future<String>> futures = e.invokeAll(l);
1647 for (Future<String> future : futures)
1808 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(),
1844 List<Future<Strin
[all...]
H A DThreadPoolExecutorTest.java25 import java.util.concurrent.Future;
1443 Future<String> future = e.submit(new StringTask());
1458 Future<?> future = e.submit(new NoOpRunnable());
1473 Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
1594 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
1629 List<Future<String>> futures = e.invokeAll(l);
1652 List<Future<String>> futures = e.invokeAll(l);
1654 for (Future<String> future : futures)
1815 List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(),
1851 List<Future<Strin
[all...]
H A DFutureTaskTest.java24 import java.util.concurrent.Future;
44 void checkIsDone(Future<?> f) {
82 void checkNotDone(Future<?> f) {
93 void checkIsRunning(Future<?> f) {
110 <T> void checkCompletedNormally(Future<T> f, T expected) {
122 void checkCancelled(Future<?> f) {
147 void checkCompletedAbnormally(Future<?> f, Throwable t) {
825 final List<Future<?>> futures = new ArrayList<>();
837 for (Future<?> future : futures)
H A DJSR166TestCase.java46 import java.util.concurrent.Future;
939 ArrayList<Future<?>> futures = new ArrayList<>(actions.length);
943 for (Future<?> future : futures)
1026 void assertFutureTimesOut(Future future) {
1033 void assertFutureTimesOut(Future future, long timeoutMillis) {
1264 <T> void checkTimedGet(Future<T> f, T expectedValue, long timeoutMillis) {
1273 <T> void checkTimedGet(Future<T> f, T expectedValue) {
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DCompletedFuture.java28 import java.util.concurrent.Future;
34 * A Future representing the result of an I/O operation that has already
38 final class CompletedFuture<V> implements Future<V> {
/libcore/support/src/test/java/tests/support/
H A DSupport_Exec.java33 import java.util.concurrent.Future;
87 Future<String> errFuture = executorService.submit(
89 Future<String> outFuture = executorService.submit(
127 Future<String> errFuture =
129 Future<String> outFuture =
/libcore/support/src/test/java/libcore/javax/net/ssl/
H A DTestSSLSocketPair.java23 import java.util.concurrent.Future;
80 Future s = executor.submit(new Callable<Void>() {
89 Future c = executor.submit(new Callable<Void>() {
/libcore/luni/src/test/java/libcore/javax/net/ssl/
H A DSSLSocketTest.java47 import java.util.concurrent.Future;
350 Future<Void> future = executor.submit(new Callable<Void>() {
408 final Future<byte[]> future1 = executor.submit(new SSLServerSessionIdCallable(server1));
421 final Future<byte[]> future2 = executor.submit(new SSLServerSessionIdCallable(server2));
445 Future<Void> future = executor.submit(new Callable<Void>() {
475 Future<Void> future = executor.submit(new Callable<Void>() {
505 Future<Void> future = executor.submit(new Callable<Void>() {
525 Future<Void> future = executor.submit(new Callable<Void>() {
648 Future<Void> future = executor.submit(new Callable<Void>() {
714 Future<IOExceptio
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DOutputStreamTesterTest.java43 import java.util.concurrent.Future;
117 private Future<byte[]> future;
H A DWriterTesterTest.java42 import java.util.concurrent.Future;
110 private Future<char[]> future;

Completed in 470 milliseconds

12