/libcore/ojluni/src/main/java/sun/nio/ch/ |
H A D | Cancellable.java | 38 void onCancel(PendingFuture<?,?> task); argument
|
H A D | AsynchronousChannelGroupImpl.java | 63 // task queue for when using a fixed thread pool. In that case, thread 107 private Runnable bindToGroup(final Runnable task) { argument 112 task.run(); 117 private void startInternalThread(final Runnable task) { argument 123 ThreadPool.defaultThreadFactory().newThread(task).start(); 129 protected final void startThreads(Runnable task) { argument 132 startInternalThread(task); 137 task = bindToGroup(task); 140 pool.executor().execute(task); 156 threadExit(Runnable task, boolean replaceMe) argument 177 executeOnHandlerTask(Runnable task) argument 184 executeOnPooledThread(Runnable task) argument 192 offerTask(Runnable task) argument 200 schedule(Runnable task, long timeout, TimeUnit unit) argument 316 execute(Runnable task) argument [all...] |
H A D | EPollPort.java | 144 void executeOnHandlerTask(Runnable task) { argument 148 offerTask(task); 278 // handle wakeup to execute task or shutdown 280 Runnable task = pollTask(); 281 if (task == null) { 285 // run task (may throw error/exception) 287 task.run();
|
H A D | PendingFuture.java | 34 * attachment of an additional arbitrary context object and a timer task. 53 // optional timer task that is cancelled when result becomes available 107 void setTimeoutTask(Future<?> task) { argument 110 task.cancel(false); 112 this.timeoutTask = task;
|
H A D | SimpleAsynchronousFileChannelImpl.java | 196 Runnable task = new Runnable() { 231 executor.execute(task); 311 Runnable task = new Runnable() { 339 executor.execute(task); 365 Runnable task = new Runnable() { 393 executor.execute(task);
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
H A D | FutureTaskTest.java | 256 * 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 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...] |
H A D | ExecutorsTest.java | 200 * a newSingleThreadScheduledExecutor successfully runs delayed task 206 final Runnable task = new CheckedRunnable() { 211 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), 224 * a newScheduledThreadPool successfully runs delayed task 230 final Runnable task = new CheckedRunnable() { 235 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), 248 * an unconfigurable newScheduledThreadPool successfully runs delayed task 256 final Runnable task = new CheckedRunnable() { 261 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), 453 Callable task [all...] |
H A D | ScheduledExecutorTest.java | 56 final Runnable task = new CheckedRunnable() { 58 p.execute(task); 71 Callable task = new CheckedCallable<Boolean>() { 77 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); 92 Runnable task = new CheckedRunnable() { 97 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); 112 Runnable task = new CheckedRunnable() { 118 p.scheduleAtFixedRate(task, timeoutMillis(), 134 Runnable task = new CheckedRunnable() { 140 p.scheduleWithFixedDelay(task, timeoutMilli [all...] |
H A D | ForkJoinTask8Test.java | 29 * defining a version of BinaryAsyncAction that uses JDK8 task 378 * invoke returns when task completes normally. 399 * quietlyInvoke task returns when task completes normally. 420 * join of a forked task returns when task completes 440 * get of a forked task returns when task completes 460 * timed get of a forked task returns when task complete [all...] |
/libcore/ojluni/src/main/java/java/util/concurrent/ |
H A D | ExecutorCompletionService.java | 115 QueueingFuture(RunnableFuture<V> task, argument 117 super(task, null); 118 this.task = task; 121 private final Future<V> task; field in class:ExecutorCompletionService.QueueingFuture 123 protected void done() { completionQueue.add(task); } 126 private RunnableFuture<V> newTaskFor(Callable<V> task) { argument 128 return new FutureTask<V>(task); 130 return aes.newTaskFor(task); 133 private RunnableFuture<V> newTaskFor(Runnable task, argument 180 submit(Callable<V> task) argument 187 submit(Runnable task, V result) argument [all...] |
H A D | CompletionService.java | 56 * submitting a task to a {@code CompletionService} 58 * actions taken by that task, which in turn <i>happen-before</i> 63 * Submits a value-returning task for execution and returns a Future 64 * representing the pending results of the task. Upon completion, 65 * this task may be taken or polled. 67 * @param task the task to submit 68 * @return a Future representing pending completion of the task 69 * @throws RejectedExecutionException if the task cannot be 71 * @throws NullPointerException if the task i 73 submit(Callable<V> task) argument 89 submit(Runnable task, V result) argument [all...] |
H A D | Executors.java | 105 * engage in, task processing. The actual number of threads may 170 * sequentially, and no more than one task will be active at any 251 * sequentially, and no more than one task will be active at any 268 * guaranteed to execute sequentially, and no more than one task 369 * called, runs the given task and returns the given result. This 372 * @param task the task to run 376 * @throws NullPointerException if task null 378 public static <T> Callable<T> callable(Runnable task, T result) { argument 379 if (task 391 callable(Runnable task) argument 450 private final Runnable task; field in class:Executors.RunnableAdapter 452 RunnableAdapter(Runnable task, T result) argument 466 final Callable<T> task; field in class:Executors.PrivilegedCallable 469 PrivilegedCallable(Callable<T> task) argument 494 final Callable<T> task; field in class:Executors.PrivilegedCallableUsingCurrentClassLoader 498 PrivilegedCallableUsingCurrentClassLoader(Callable<T> task) argument 629 submit(Runnable task) argument 632 submit(Callable<T> task) argument 635 submit(Runnable task, T result) argument [all...] |
H A D | ExecutorService.java | 133 * submission of a {@code Runnable} or {@code Callable} task to an 136 * any actions taken by that task, which in turn <i>happen-before</i> the 167 * task that fails to respond to interrupts may never terminate. 204 * Submits a value-returning task for execution and returns a 205 * Future representing the pending results of the task. The 206 * Future's {@code get} method will return the task's result upon 211 * for a task, you can use constructions of the form 219 * @param task the task to submit 220 * @param <T> the type of the task' 226 submit(Callable<T> task) argument 241 submit(Runnable task, T result) argument 254 submit(Runnable task) argument [all...] |
H A D | AbstractExecutorService.java | 83 * @param runnable the runnable task being wrapped 89 * the underlying task 97 * Returns a {@code RunnableFuture} for the given callable task. 99 * @param callable the callable task being wrapped 104 * cancellation of the underlying task 115 public Future<?> submit(Runnable task) { argument 116 if (task == null) throw new NullPointerException(); 117 RunnableFuture<Void> ftask = newTaskFor(task, null); 126 public <T> Future<T> submit(Runnable task, T result) { argument 127 if (task 137 submit(Callable<T> task) argument [all...] |
H A D | ScheduledThreadPoolExecutor.java | 69 * <p>When a submitted task is cancelled before it is run, execution 70 * is suppressed. By default, such a cancelled task is not 75 * <p>Successive executions of a periodic task scheduled via 96 * control per-task delays and scheduling. To preserve 99 * disables additional task customization. However, this class 102 * {@code Callable}) that can be used to customize the concrete task 106 * {@code ScheduledThreadPoolExecutor} uses a task type extending 116 * Runnable r, RunnableScheduledFuture<V> task) { 117 * return new CustomTask<V>(r, task); 121 * Callable<V> c, RunnableScheduledFuture<V> task) { 332 delayedExecute(RunnableScheduledFuture<?> task) argument 352 reExecutePeriodic(RunnableScheduledFuture<?> task) argument 407 decorateTask( Runnable runnable, RunnableScheduledFuture<V> task) argument 424 decorateTask( Callable<V> callable, RunnableScheduledFuture<V> task) argument 663 submit(Runnable task) argument 671 submit(Runnable task, T result) argument 679 submit(Callable<T> task) argument [all...] |
H A D | ForkJoinPool.java | 94 * main task execution methods summarized in the following table. 106 * <caption>Summary of task execution methods</caption> 212 * Adding tasks then takes the form of a classic array push(task) 214 * q.array[q.top++ % length] = task; 223 * if ((the task at top slot is not null) and 225 * decrement top and return task; 228 * if ((the task at base slot is not null) and 230 * increment base and return task; 273 * local task processing is in FIFO, not LIFO order, simply by 286 * others with the same root task) 867 push(ForkJoinTask<?> task) argument 1001 tryUnpush(ForkJoinTask<?> task) argument 1019 sharedPush(ForkJoinTask<?> task) argument 1044 growAndSharedPush(ForkJoinTask<?> task) argument 1060 trySharedUnpush(ForkJoinTask<?> task) argument 1150 runTask(ForkJoinTask<?> task) argument 1191 tryRemoveAndExec(ForkJoinTask<?> task) argument 1244 popCC(CountedCompleter<?> task, int mode) argument 1294 pollAndExecCC(CountedCompleter<?> task) argument 2032 helpComplete(WorkQueue w, CountedCompleter<?> task, int maxTasks) argument 2091 helpStealer(WorkQueue w, ForkJoinTask<?> task) argument 2223 awaitJoin(WorkQueue w, ForkJoinTask<?> task, long deadline) argument 2526 externalPush(ForkJoinTask<?> task) argument 2554 externalSubmit(ForkJoinTask<T> task) argument 2582 tryExternalUnpush(ForkJoinTask<?> task) argument 2594 externalHelpComplete(CountedCompleter<?> task, int maxTasks) argument 2743 invoke(ForkJoinTask<T> task) argument 2758 execute(ForkJoinTask<?> task) argument 2769 execute(Runnable task) argument 2790 submit(ForkJoinTask<T> task) argument 2799 submit(Callable<T> task) argument 2808 submit(Runnable task, T result) argument 2817 submit(Runnable task) argument [all...] |
H A D | ThreadPoolExecutor.java | 53 * An {@link ExecutorService} that executes each submitted task using 59 * asynchronous tasks, due to reduced per-task invocation overhead, 88 * When a new task is submitted in method {@link #execute(Runnable)}, 164 * this would exceed maximumPoolSize, in which case, the task will be 174 * without otherwise holding them. Here, an attempt to queue a task 189 * each task is completely independent of others, so tasks cannot 232 * that invokes {@code execute} itself runs the task. This provides a 236 * <li>In {@link ThreadPoolExecutor.DiscardPolicy}, a task that 240 * executor is not shut down, the task at the head of the work queue 257 * before and after execution of each task 1778 remove(Runnable task) argument [all...] |
/libcore/ojluni/src/main/java/java/util/ |
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 | AbstractShortCircuitTask.java | 53 * Indicates whether this task has been canceled. Tasks may cancel other 55 * find-first operation, a task that finds a value will cancel all tasks 77 * @param parent parent task in the computation tree 79 * computation tree described by this task 88 * Returns the value indicating the computation completed with no task 92 * @return the result to return when no task finds a result 106 @SuppressWarnings("unchecked") K task = (K) this; 110 if (task.taskCanceled()) { 111 result = task.getEmptyResult(); 115 result = task [all...] |
H A D | AbstractTask.java | 34 * Each task is associated with a {@link Spliterator} that describes the portion 35 * of the input associated with the subtree rooted at this task. 41 * <p>This class is based on {@link CountedCompleter}, a form of fork-join task 42 * where each task has a semaphore-like count of uncompleted children, and the 43 * task is implicitly completed and notified when its last child completes. 46 * current task's result. 48 * <p>Splitting and setting up the child task links is done by {@code compute()} 53 * <p>For example, a task that performs a reduce would override {@code doLeaf()} 104 * rooted at this task 147 * @param parent this node's parent task [all...] |
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...] |
H A D | Nodes.java | 1864 SizedCollectorTask<P_IN, P_OUT, T_SINK, K> task = this; 1866 while (rightSplit.estimateSize() > task.targetSize && 1868 task.setPendingCount(1); 1870 task.makeChild(leftSplit, task.offset, leftSplitSize).fork(); 1871 task = task.makeChild(rightSplit, task.offset + leftSplitSize, 1872 task.length - leftSplitSize); 1875 assert task [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/sun/nio/fs/ |
H A D | Cancellable.java | 32 * Base implementation of a task (typically native) that polls a memory location 34 * task is executed by invoking the {@link runInterruptibly} method defined 63 * task has been cancelled. If this method is not overridden then it 71 * "cancels" the task by writing bits into memory location that it polled 72 * by the task. 83 * Returns the exception thrown by the task or null if the task completed 109 * The task body. This should periodically poll the memory location 115 * Invokes the given task in its own thread. If this (meaning the current) 119 static void runInterruptibly(Cancellable task) throw argument [all...] |