Searched refs:task (Results 1 - 19 of 19) sorted by relevance

/libcore/luni/src/main/java/java/util/concurrent/
H A DExecutorCompletionService.java87 QueueingFuture(RunnableFuture<V> task) { argument
88 super(task, null);
89 this.task = task;
91 protected void done() { completionQueue.add(task); }
92 private final Future<V> task; field in class:ExecutorCompletionService.QueueingFuture
95 private RunnableFuture<V> newTaskFor(Callable<V> task) { argument
97 return new FutureTask<V>(task);
99 return aes.newTaskFor(task);
102 private RunnableFuture<V> newTaskFor(Runnable task, argument
149 submit(Callable<V> task) argument
156 submit(Runnable task, V result) argument
[all...]
H A DCompletionService.java27 * submitting a task to a {@code CompletionService}
29 * actions taken by that task, which in turn <i>happen-before</i>
34 * Submits a value-returning task for execution and returns a Future
35 * representing the pending results of the task. Upon completion,
36 * this task may be taken or polled.
38 * @param task the task to submit
39 * @return a Future representing pending completion of the task
40 * @throws RejectedExecutionException if the task cannot be
42 * @throws NullPointerException if the task i
44 submit(Callable<V> task) argument
60 submit(Runnable task, V result) argument
[all...]
H A DExecutors.java72 * engage in, task processing. The actual number of threads may
137 * sequentially, and no more than one task will be active at any
218 * sequentially, and no more than one task will be active at any
235 * guaranteed to execute sequentially, and no more than one task
336 * called, runs the given task and returns the given result. This
339 * @param task the task to run
342 * @throws NullPointerException if task null
344 public static <T> Callable<T> callable(Runnable task, T result) { argument
345 if (task
357 callable(Runnable task) argument
416 final Runnable task; field in class:Executors.RunnableAdapter
418 RunnableAdapter(Runnable task, T result) argument
432 private final Callable<T> task; field in class:Executors.PrivilegedCallable
435 PrivilegedCallable(Callable<T> task) argument
459 private final Callable<T> task; field in class:Executors.PrivilegedCallableUsingCurrentClassLoader
463 PrivilegedCallableUsingCurrentClassLoader(Callable<T> task) argument
593 submit(Runnable task) argument
596 submit(Callable<T> task) argument
599 submit(Runnable task, T result) argument
[all...]
H A DExecutorService.java104 * submission of a {@code Runnable} or {@code Callable} task to an
107 * any actions taken by that task, which in turn <i>happen-before</i> the
138 * task that fails to respond to interrupts may never terminate.
175 * Submits a value-returning task for execution and returns a
176 * Future representing the pending results of the task. The
177 * Future's {@code get} method will return the task's result upon
182 * for a task, you can use constructions of the form
190 * @param task the task to submit
191 * @return a Future representing pending completion of the task
196 submit(Callable<T> task) argument
210 submit(Runnable task, T result) argument
223 submit(Runnable task) argument
[all...]
H A DAbstractExecutorService.java49 * @param runnable the runnable task being wrapped
54 * the underlying task
62 * Returns a {@code RunnableFuture} for the given callable task.
64 * @param callable the callable task being wrapped
68 * cancellation of the underlying task
79 public Future<?> submit(Runnable task) { argument
80 if (task == null) throw new NullPointerException();
81 RunnableFuture<Void> ftask = newTaskFor(task, null);
90 public <T> Future<T> submit(Runnable task, T result) { argument
91 if (task
101 submit(Callable<T> task) argument
[all...]
H A DForkJoinPool.java60 * main task execution methods summarized in the following table.
72 * <caption>Summary of task execution methods</caption>
187 * task processing is in FIFO, not LIFO order, simply by using
258 * speeds up task scanning.
260 * All worker thread creation is on-demand, triggered by task
298 * races, mainly that a task-producing thread can miss seeing (and
316 * appears to be at least one task they might be able to find and
318 * task to a queue that has fewer than two tasks, they signal
322 * a task from a queue and notice that there are other tasks there
355 * to join a task stole
683 push(ForkJoinTask<?> task) argument
843 runTask(ForkJoinTask<?> task) argument
875 tryRemoveAndExec(ForkJoinTask<?> task) argument
1462 externalPush(ForkJoinTask<?> task) argument
1502 fullExternalPush(ForkJoinTask<?> task) argument
1799 tryHelpStealer(WorkQueue joiner, ForkJoinTask<?> task) argument
1884 helpComplete(WorkQueue joiner, CountedCompleter<?> task) argument
1974 awaitJoin(WorkQueue joiner, ForkJoinTask<?> task) argument
2023 helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) argument
2295 tryExternalUnpush(ForkJoinTask<?> task) argument
2318 externalHelpComplete(CountedCompleter<?> task) argument
2478 invoke(ForkJoinTask<T> task) argument
2493 execute(ForkJoinTask<?> task) argument
2506 execute(Runnable task) argument
2526 submit(ForkJoinTask<T> task) argument
2538 submit(Callable<T> task) argument
2549 submit(Runnable task, T result) argument
2560 submit(Runnable task) argument
[all...]
H A DScheduledThreadPoolExecutor.java34 * <p>When a submitted task is cancelled before it is run, execution
35 * is suppressed. By default, such a cancelled task is not
40 * <p>Successive executions of a periodic task scheduled via
61 * control per-task delays and scheduling. To preserve
64 * disables additional task customization. However, this class
67 * {@code Callable}) that can be used to customize the concrete task
71 * {@code ScheduledThreadPoolExecutor} uses a task type extending
81 * Runnable r, RunnableScheduledFuture<V> task) {
82 * return new CustomTask<V>(r, task);
86 * Callable<V> c, RunnableScheduledFuture<V> task) {
300 delayedExecute(RunnableScheduledFuture<?> task) argument
320 reExecutePeriodic(RunnableScheduledFuture<?> task) argument
374 decorateTask( Runnable runnable, RunnableScheduledFuture<V> task) argument
390 decorateTask( Callable<V> callable, RunnableScheduledFuture<V> task) argument
625 submit(Runnable task) argument
633 submit(Runnable task, T result) argument
641 submit(Callable<T> task) argument
[all...]
H A DThreadPoolExecutor.java20 * An {@link ExecutorService} that executes each submitted task using
26 * asynchronous tasks, due to reduced per-task invocation overhead,
54 * When a new task is submitted in method {@link #execute(Runnable)},
121 * this would exceed maximumPoolSize, in which case, the task will be
131 * without otherwise holding them. Here, an attempt to queue a task
146 * each task is completely independent of others, so tasks cannot
188 * that invokes {@code execute} itself runs the task. This provides a
192 * <li> In {@link ThreadPoolExecutor.DiscardPolicy}, a task that
196 * executor is not shut down, the task at the head of the work queue
212 * before and after execution of each task
1718 remove(Runnable task) argument
[all...]
H A DForkJoinTask.java45 * until the task's result has been computed. Computations should
58 * exhaustion, such as failure to allocate internal task
67 * of few if any <em>other</em> tasks should be dependent on a task
79 * results of a task is {@link #join}, but there are several variants:
100 * of detail: {@link #isDone} is true if a task completed in any way
101 * (including the case where a task was cancelled without executing);
102 * {@link #isCompletedNormally} is true if a task completed without
104 * true if the task was cancelled (in which case {@link #getException}
106 * {@link #isCompletedAbnormally} is true if a task was either
142 * underlying lightweight task schedulin
405 ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next) argument
[all...]
/libcore/jsr166-tests/src/test/java/jsr166/
H A DFutureTaskTest.java256 * isDone is true when a task completes
259 PublicFutureTask task = new PublicFutureTask(new NoOpCallable());
260 assertFalse(task.isDone());
261 task.run();
262 assertTrue(task.isDone());
263 checkCompletedNormally(task, Boolean.TRUE);
264 assertEquals(1, task.runCount());
268 * runAndReset of a non-cancelled task succeeds
271 PublicFutureTask task = new PublicFutureTask(new NoOpCallable());
273 assertTrue(task
[all...]
H A DScheduledExecutorSubclassTest.java47 RunnableScheduledFuture<V> task; field in class:ScheduledExecutorSubclassTest.CustomTask
49 CustomTask(RunnableScheduledFuture<V> t) { task = t; }
50 public boolean isPeriodic() { return task.isPeriodic(); }
53 task.run();
55 public long getDelay(TimeUnit unit) { return task.getDelay(unit); }
57 return task.compareTo(((CustomTask)t).task);
60 return task.cancel(mayInterruptIfRunning);
62 public boolean isCancelled() { return task.isCancelled(); }
63 public boolean isDone() { return task
78 decorateTask(Runnable r, RunnableScheduledFuture<V> task) argument
82 decorateTask(Callable<V> c, RunnableScheduledFuture<V> task) argument
[all...]
H A DScheduledExecutorTest.java49 final Runnable task = new CheckedRunnable() {
54 p.execute(task);
69 Callable task = new CheckedCallable<Boolean>() {
75 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS);
92 Runnable task = new CheckedRunnable() {
97 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS);
114 Runnable task = new CheckedRunnable() {
120 p.scheduleAtFixedRate(task, timeoutMillis(),
138 Runnable task = new CheckedRunnable() {
144 p.scheduleWithFixedDelay(task, timeoutMilli
[all...]
H A DExecutorsTest.java194 * a newSingleThreadScheduledExecutor successfully runs delayed task
200 final Runnable task = new CheckedRunnable() {
205 Future f = p.schedule(Executors.callable(task, Boolean.TRUE),
220 * a newScheduledThreadPool successfully runs delayed task
226 final Runnable task = new CheckedRunnable() {
231 Future f = p.schedule(Executors.callable(task, Boolean.TRUE),
246 * an unconfigurable newScheduledThreadPool successfully runs delayed task
254 final Runnable task = new CheckedRunnable() {
259 Future f = p.schedule(Executors.callable(task, Boolean.TRUE),
459 Callable task
[all...]
H A DThreadPoolExecutorTest.java93 final Runnable task = new CheckedRunnable() {
98 p.execute(task);
529 Callable task = new CheckedCallable<Boolean>() {
536 tasks[i] = new FutureTask(task);
551 * remove(task) removes queued task, and fails to remove active task
601 Callable task = new CheckedCallable<Boolean>() {
607 tasks[i] = new FutureTask(task);
1033 Callable task
[all...]
H A DThreadPoolExecutorSubclassTest.java235 final Runnable task = new CheckedRunnable() {
240 p.execute(task);
604 Callable task = new CheckedCallable<Boolean>() {
611 tasks[i] = new FutureTask(task);
626 * remove(task) removes queued task, and fails to remove active task
676 Callable task = new CheckedCallable<Boolean>() {
682 tasks[i] = new FutureTask(task);
1022 Runnable task
[all...]
/libcore/luni/src/main/java/java/util/
H A DTimer.java26 * this thread is busy running a task, runnable tasks may be subject to delays.
34 * successive run of a task is scheduled relative to the start time of
38 * successive run of a task is scheduled without regard for when the
48 * <p>This class does not offer guarantees about the real-time nature of task
73 public void insert(TimerTask task) { argument
79 timers[size++] = task;
155 private int getTask(TimerTask task) { argument
157 if (timers[i] == task) {
202 TimerTask task;
212 // no tasks scheduled -- sleep until any task appea
431 schedule(TimerTask task, Date when) argument
452 schedule(TimerTask task, long delay) argument
474 schedule(TimerTask task, long delay, long period) argument
497 schedule(TimerTask task, Date when, long period) argument
521 scheduleAtFixedRate(TimerTask task, long delay, long period) argument
544 scheduleAtFixedRate(TimerTask task, Date when, long period) argument
555 scheduleImpl(TimerTask task, long delay, long period, boolean fixed) argument
[all...]
/libcore/luni/src/test/java/tests/support/
H A DThreadPool.java44 public synchronized void runTask(Runnable task) { argument
48 if (task != null) {
49 taskQueue.add(task);
99 Runnable task = null;
101 task = getTask();
106 if (task == null) {
112 task.run();
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
H A DTimerTest.java98 private void awaitRun(TimerTestTask task) throws Exception { argument
99 while (task.wasRun() == 0) {
110 // Ensure a task is run
129 // Ensure a task is run
148 // Ensure a task is run
178 // Ensure a task is run
202 // Ensure a task throws an IllegalStateException after cancelled
208 fail("Scheduling a task after Timer.cancel() should throw exception");
212 // Ensure a task is run but not after cancel
315 fail("Scheduling a task afte
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
H A DSSLEngineTest.java1098 Runnable task;
1099 while ((task = engine.getDelegatedTask()) != null) {
1100 task.run();

Completed in 274 milliseconds