/libcore/luni/src/main/java/java/util/concurrent/ |
H A D | CompletionService.java | 27 * 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 D | ExecutorCompletionService.java | 86 QueueingFuture(RunnableFuture<V> task, argument 88 super(task, null); 89 this.task = task; 92 private final Future<V> task; field in class:ExecutorCompletionService.QueueingFuture 94 protected void done() { completionQueue.add(task); } 97 private RunnableFuture<V> newTaskFor(Callable<V> task) { argument 99 return new FutureTask<V>(task); 101 return aes.newTaskFor(task); 104 private RunnableFuture<V> newTaskFor(Runnable task, argument 151 submit(Callable<V> task) argument 158 submit(Runnable task, V result) argument [all...] |
H A D | ExecutorService.java | 104 * 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 * @param <T> the type of the task' 197 submit(Callable<T> task) argument 212 submit(Runnable task, T result) argument 225 submit(Runnable task) argument [all...] |
H A D | AbstractExecutorService.java | 54 * @param runnable the runnable task being wrapped 60 * the underlying task 68 * Returns a {@code RunnableFuture} for the given callable task. 70 * @param callable the callable task being wrapped 75 * cancellation of the underlying task 86 public Future<?> submit(Runnable task) { argument 87 if (task == null) throw new NullPointerException(); 88 RunnableFuture<Void> ftask = newTaskFor(task, null); 97 public <T> Future<T> submit(Runnable task, T result) { argument 98 if (task 108 submit(Callable<T> task) argument [all...] |
H A D | Executors.java | 76 * engage in, task processing. The actual number of threads may 141 * sequentially, and no more than one task will be active at any 222 * sequentially, and no more than one task will be active at any 239 * guaranteed to execute sequentially, and no more than one task 340 * called, runs the given task and returns the given result. This 343 * @param task the task to run 347 * @throws NullPointerException if task null 349 public static <T> Callable<T> callable(Runnable task, T result) { argument 350 if (task 362 callable(Runnable task) argument 421 private final Runnable task; field in class:Executors.RunnableAdapter 423 RunnableAdapter(Runnable task, T result) argument 437 final Callable<T> task; field in class:Executors.PrivilegedCallable 440 PrivilegedCallable(Callable<T> task) argument 465 final Callable<T> task; field in class:Executors.PrivilegedCallableUsingCurrentClassLoader 469 PrivilegedCallableUsingCurrentClassLoader(Callable<T> task) argument 600 submit(Runnable task) argument 603 submit(Callable<T> task) argument 606 submit(Runnable task, T result) argument [all...] |
H A D | ForkJoinTask.java | 49 * until the task's result has been computed. Computations should 62 * exhaustion, such as failure to allocate internal task 71 * of few if any <em>other</em> tasks should be dependent on a task 84 * results of a task is {@link #join}, but there are several variants: 105 * of detail: {@link #isDone} is true if a task completed in any way 106 * (including the case where a task was cancelled without executing); 107 * {@link #isCompletedNormally} is true if a task completed without 109 * true if the task was cancelled (in which case {@link #getException} 111 * {@link #isCompletedAbnormally} is true if a task was either 149 * underlying lightweight task schedulin 412 ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next, ReferenceQueue<Object> exceptionTableRefQueue) argument [all...] |
H A D | ScheduledThreadPoolExecutor.java | 40 * <p>When a submitted task is cancelled before it is run, execution 41 * is suppressed. By default, such a cancelled task is not 46 * <p>Successive executions of a periodic task scheduled via 67 * control per-task delays and scheduling. To preserve 70 * disables additional task customization. However, this class 73 * {@code Callable}) that can be used to customize the concrete task 77 * {@code ScheduledThreadPoolExecutor} uses a task type extending 87 * Runnable r, RunnableScheduledFuture<V> task) { 88 * return new CustomTask<V>(r, task); 92 * Callable<V> c, RunnableScheduledFuture<V> task) { 303 delayedExecute(RunnableScheduledFuture<?> task) argument 323 reExecutePeriodic(RunnableScheduledFuture<?> task) argument 378 decorateTask( Runnable runnable, RunnableScheduledFuture<V> task) argument 395 decorateTask( Callable<V> callable, RunnableScheduledFuture<V> task) argument 634 submit(Runnable task) argument 642 submit(Runnable task, T result) argument 650 submit(Callable<T> task) argument [all...] |
H A D | ThreadPoolExecutor.java | 24 * An {@link ExecutorService} that executes each submitted task using 30 * asynchronous tasks, due to reduced per-task invocation overhead, 59 * When a new task is submitted in method {@link #execute(Runnable)}, 135 * this would exceed maximumPoolSize, in which case, the task will be 145 * without otherwise holding them. Here, an attempt to queue a task 160 * each task is completely independent of others, so tasks cannot 203 * that invokes {@code execute} itself runs the task. This provides a 207 * <li>In {@link ThreadPoolExecutor.DiscardPolicy}, a task that 211 * executor is not shut down, the task at the head of the work queue 228 * before and after execution of each task 1749 remove(Runnable task) argument [all...] |
H A D | ForkJoinPool.java | 65 * main task execution methods summarized in the following table. 77 * <caption>Summary of task execution methods</caption> 183 * Adding tasks then takes the form of a classic array push(task) 185 * q.array[q.top++ % length] = task; 194 * if ((the task at top slot is not null) and 196 * decrement top and return task; 199 * if ((the task at base slot is not null) and 201 * increment base and return task; 244 * local task processing is in FIFO, not LIFO order, simply by 257 * others with the same root task) 838 push(ForkJoinTask<?> task) argument 972 tryUnpush(ForkJoinTask<?> task) argument 990 sharedPush(ForkJoinTask<?> task) argument 1015 growAndSharedPush(ForkJoinTask<?> task) argument 1031 trySharedUnpush(ForkJoinTask<?> task) argument 1121 runTask(ForkJoinTask<?> task) argument 1162 tryRemoveAndExec(ForkJoinTask<?> task) argument 1215 popCC(CountedCompleter<?> task, int mode) argument 1265 pollAndExecCC(CountedCompleter<?> task) argument 2003 helpComplete(WorkQueue w, CountedCompleter<?> task, int maxTasks) argument 2062 helpStealer(WorkQueue w, ForkJoinTask<?> task) argument 2194 awaitJoin(WorkQueue w, ForkJoinTask<?> task, long deadline) argument 2497 externalPush(ForkJoinTask<?> task) argument 2525 externalSubmit(ForkJoinTask<T> task) argument 2553 tryExternalUnpush(ForkJoinTask<?> task) argument 2565 externalHelpComplete(CountedCompleter<?> task, int maxTasks) argument 2714 invoke(ForkJoinTask<T> task) argument 2729 execute(ForkJoinTask<?> task) argument 2740 execute(Runnable task) argument 2761 submit(ForkJoinTask<T> task) argument 2770 submit(Callable<T> task) argument 2779 submit(Runnable task, T result) argument 2788 submit(Runnable task) argument [all...] |
/libcore/luni/src/test/java/tests/support/ |
H A D | ThreadPool.java | 44 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/ojluni/src/main/java/java/util/ |
H A D | ArraysParallelSortHelpers.java | 64 * so don't hold any task state. 78 * Style note: The task classes have a lot of parameters, that are 79 * stored as task fields and copied to local variables and used in 86 * A placeholder task for Sorters, used for the lowest 87 * quartile task, that does not need to maintain array state. 100 final CountedCompleter<?> task; field in class:ArraysParallelSortHelpers.Relay 101 Relay(CountedCompleter<?> task) { argument 103 this.task = task; 107 task [all...] |
H A D | Timer.java | 37 * Timer tasks should complete quickly. If a timer task takes excessive time 38 * to complete, it "hogs" the timer's task execution thread. This can, in 40 * execute in rapid succession when (and if) the offending task finally 44 * <i>and</i> all outstanding tasks have completed execution, the timer's task 47 * default, the task execution thread does not run as a <i>daemon thread</i>, 49 * wants to terminate a timer's task execution thread rapidly, the caller 52 * <p>If the timer's task execution thread terminates unexpectedly, for 54 * attempt to schedule a task on the timer will result in an 78 * it uses a binary heap to represent its task queue, so the cost to schedule 79 * a task i 190 schedule(TimerTask task, long delay) argument 207 schedule(TimerTask task, Date time) argument 243 schedule(TimerTask task, long delay, long period) argument 284 schedule(TimerTask task, Date firstTime, long period) argument 323 scheduleAtFixedRate(TimerTask task, long delay, long period) argument 366 scheduleAtFixedRate(TimerTask task, Date firstTime, long period) argument 386 sched(TimerTask task, long time, long period) argument 596 add(TimerTask task) argument [all...] |
/libcore/ojluni/src/main/java/java/util/stream/ |
H A D | ForEachOps.java | 287 ForEachTask<S, T> task = this; 291 task.helper.copyInto(taskSink, rightSplit); 294 ForEachTask<S, T> leftTask = new ForEachTask<>(task, leftSplit); 295 task.addToPendingCount(1); 300 taskToFork = task; 301 task = leftTask; 310 task.spliterator = null; 311 task.propagateCompletion(); 322 * Our goal is to ensure that the elements associated with a task are 325 * a task doe 403 doCompute(ForEachOrderedTask<S, T> task) argument [all...] |
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
H A D | TimerTest.java | 102 private void awaitRun(TimerTestTask task) throws Exception { argument 103 while (task.wasRun() == 0) { 114 // Ensure a task is run 133 // Ensure a task is run 152 // Ensure a task is run 182 // Ensure a task is run 206 // Ensure a task throws an IllegalStateException after cancelled 212 fail("Scheduling a task after Timer.cancel() should throw exception"); 216 // Ensure a task is run but not after cancel 319 fail("Scheduling a task afte [all...] |
/libcore/jsr166-tests/src/test/java/jsr166/ |
H A D | ScheduledExecutorSubclassTest.java | 53 RunnableScheduledFuture<V> task; field in class:ScheduledExecutorSubclassTest.CustomTask 55 CustomTask(RunnableScheduledFuture<V> t) { task = t; } 56 public boolean isPeriodic() { return task.isPeriodic(); } 59 task.run(); 61 public long getDelay(TimeUnit unit) { return task.getDelay(unit); } 63 return task.compareTo(((CustomTask)t).task); 66 return task.cancel(mayInterruptIfRunning); 68 public boolean isCancelled() { return task.isCancelled(); } 69 public boolean isDone() { return task 84 decorateTask(Runnable r, RunnableScheduledFuture<V> task) argument 88 decorateTask(Callable<V> c, RunnableScheduledFuture<V> task) argument [all...] |