Home
last modified time | relevance | path

Searched refs:task (Results 1 – 21 of 21) sorted by relevance

/libcore/jsr166-tests/src/test/java/jsr166/
DFutureTaskTest.java241 PublicFutureTask task = new PublicFutureTask(new NoOpCallable()); in testIsDone() local
242 assertFalse(task.isDone()); in testIsDone()
243 task.run(); in testIsDone()
244 assertTrue(task.isDone()); in testIsDone()
245 checkCompletedNormally(task, Boolean.TRUE); in testIsDone()
246 assertEquals(1, task.runCount()); in testIsDone()
253 PublicFutureTask task = new PublicFutureTask(new NoOpCallable()); in testRunAndReset() local
255 assertTrue(task.runAndReset()); in testRunAndReset()
256 checkNotDone(task); in testRunAndReset()
257 assertEquals(i+1, task.runCount()); in testRunAndReset()
[all …]
DScheduledExecutorSubclassTest.java18 RunnableScheduledFuture<V> task; field in ScheduledExecutorSubclassTest.CustomTask
20 CustomTask(RunnableScheduledFuture<V> t) { task = t; } in CustomTask()
21 public boolean isPeriodic() { return task.isPeriodic(); } in isPeriodic()
24 task.run(); in run()
26 public long getDelay(TimeUnit unit) { return task.getDelay(unit); } in getDelay()
28 return task.compareTo(((CustomTask)t).task); in compareTo()
31 return task.cancel(mayInterruptIfRunning); in cancel()
33 public boolean isCancelled() { return task.isCancelled(); } in isCancelled()
34 public boolean isDone() { return task.isDone(); } in isDone()
36 V v = task.get(); in get()
[all …]
DScheduledExecutorTest.java25 final Runnable task = new CheckedRunnable() { in testExecute() local
30 p.execute(task); in testExecute()
45 Callable task = new CheckedCallable<Boolean>() { in testSchedule1() local
51 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule1()
68 Runnable task = new CheckedRunnable() { in testSchedule3() local
73 Future f = p.schedule(task, timeoutMillis(), MILLISECONDS); in testSchedule3()
90 Runnable task = new CheckedRunnable() { in testSchedule4() local
96 p.scheduleAtFixedRate(task, timeoutMillis(), in testSchedule4()
114 Runnable task = new CheckedRunnable() { in testSchedule5() local
120 p.scheduleWithFixedDelay(task, timeoutMillis(), in testSchedule5()
[all …]
DExecutorsTest.java177 final Runnable task = new CheckedRunnable() { in testNewSingleThreadScheduledExecutor() local
182 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testNewSingleThreadScheduledExecutor()
203 final Runnable task = new CheckedRunnable() { in testNewScheduledThreadPool() local
208 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testNewScheduledThreadPool()
231 final Runnable task = new CheckedRunnable() { in testUnconfigurableScheduledExecutorService() local
236 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testUnconfigurableScheduledExecutorService()
436 Callable task = Executors.privilegedCallable(new CheckCCL()); in testPrivilegedCallableWithNoPrivs()
438 task.call(); in testPrivilegedCallableWithNoPrivs()
DThreadPoolExecutorTest.java65 final Runnable task = new CheckedRunnable() { in testExecute() local
70 p.execute(task); in testExecute()
501 Callable task = new CheckedCallable<Boolean>() { in testGetQueue() local
508 tasks[i] = new FutureTask(task); in testGetQueue()
573 Callable task = new CheckedCallable<Boolean>() { in testPurge() local
579 tasks[i] = new FutureTask(task); in testPurge()
1005 Callable task = new CheckedCallable<Boolean>() { in testInterruptedSubmit()
1011 p.submit(task).get(); in testInterruptedSubmit()
1033 Runnable task = new CheckedRunnable() { in testSaturatedExecute() local
1038 p.execute(task); in testSaturatedExecute()
[all …]
DThreadPoolExecutorSubclassTest.java205 final Runnable task = new CheckedRunnable() { in testExecute() local
210 p.execute(task); in testExecute()
574 Callable task = new CheckedCallable<Boolean>() { in testGetQueue() local
581 tasks[i] = new FutureTask(task); in testGetQueue()
646 Callable task = new CheckedCallable<Boolean>() { in testPurge() local
652 tasks[i] = new FutureTask(task); in testPurge()
992 Runnable task = new CheckedRunnable() { in testSaturatedExecute() local
997 p.execute(task); in testSaturatedExecute()
1000 p.execute(task); in testSaturatedExecute()
1051 for (TrackedNoOpRunnable task : tasks) in testSaturatedExecute3()
[all …]
DAbstractExecutorServiceTest.java45 CheckedRunnable task = new CheckedRunnable() { in testExecuteRunnable() local
49 Future<?> future = e.submit(task); in testExecuteRunnable()
DForkJoinPoolTest.java417 CheckedRunnable task = new CheckedRunnable() { in testExecuteRunnable() local
421 Future<?> future = e.submit(task); in testExecuteRunnable()
/libcore/luni/src/main/java/java/util/
DTimer.java73 public void insert(TimerTask task) { in insert() argument
79 timers[size++] = task; in insert()
155 private int getTask(TimerTask task) { in getTask() argument
157 if (timers[i] == task) { in getTask()
202 TimerTask task; in run() local
222 task = tasks.minimum(); in run()
225 synchronized (task.lock) { in run()
226 if (task.cancelled) { in run()
232 timeToSleep = task.when - currentTime; in run()
246 synchronized (task.lock) { in run()
[all …]
/libcore/luni/src/main/java/java/util/concurrent/
DExecutorCompletionService.java87 QueueingFuture(RunnableFuture<V> task) { in QueueingFuture() argument
88 super(task, null); in QueueingFuture()
89 this.task = task; in QueueingFuture()
91 protected void done() { completionQueue.add(task); } in done()
92 private final Future<V> task; field in ExecutorCompletionService.QueueingFuture
95 private RunnableFuture<V> newTaskFor(Callable<V> task) { in newTaskFor() argument
97 return new FutureTask<V>(task); in newTaskFor()
99 return aes.newTaskFor(task); in newTaskFor()
102 private RunnableFuture<V> newTaskFor(Runnable task, V result) { in newTaskFor() argument
104 return new FutureTask<V>(task, result); in newTaskFor()
[all …]
DExecutors.java343 public static <T> Callable<T> callable(Runnable task, T result) { in callable() argument
344 if (task == null) in callable()
346 return new RunnableAdapter<T>(task, result); in callable()
356 public static Callable<Object> callable(Runnable task) { in callable() argument
357 if (task == null) in callable()
359 return new RunnableAdapter<Object>(task, null); in callable()
415 final Runnable task;
417 RunnableAdapter(Runnable task, T result) {
418 this.task = task;
422 task.run();
[all …]
DForkJoinPool.java690 final void push(ForkJoinTask<?> task) { in push() argument
695 U.putOrderedObject(a, ((m & s) << ASHIFT) + ABASE, task); in push()
850 final void runTask(ForkJoinTask<?> task) { in runTask() argument
851 if ((currentSteal = task) != null) { in runTask()
852 task.doExec(); in runTask()
882 final boolean tryRemoveAndExec(ForkJoinTask<?> task) { in tryRemoveAndExec() argument
885 if (task != null && (a = array) != null && (m = a.length - 1) >= 0 && in tryRemoveAndExec()
894 else if (t == task) { in tryRemoveAndExec()
896 if (!U.compareAndSwapObject(a, j, task, null)) in tryRemoveAndExec()
902 removed = U.compareAndSwapObject(a, j, task, in tryRemoveAndExec()
[all …]
DAbstractExecutorService.java78 public Future<?> submit(Runnable task) { in submit() argument
79 if (task == null) throw new NullPointerException(); in submit()
80 RunnableFuture<Void> ftask = newTaskFor(task, null); in submit()
89 public <T> Future<T> submit(Runnable task, T result) { in submit() argument
90 if (task == null) throw new NullPointerException(); in submit()
91 RunnableFuture<T> ftask = newTaskFor(task, result); in submit()
100 public <T> Future<T> submit(Callable<T> task) { in submit() argument
101 if (task == null) throw new NullPointerException(); in submit()
102 RunnableFuture<T> ftask = newTaskFor(task); in submit()
DScheduledThreadPoolExecutor.java296 private void delayedExecute(RunnableScheduledFuture<?> task) { in delayedExecute() argument
298 reject(task); in delayedExecute()
300 super.getQueue().add(task); in delayedExecute()
302 !canRunInCurrentRunState(task.isPeriodic()) && in delayedExecute()
303 remove(task)) in delayedExecute()
304 task.cancel(false); in delayedExecute()
316 void reExecutePeriodic(RunnableScheduledFuture<?> task) { in reExecutePeriodic() argument
318 super.getQueue().add(task); in reExecutePeriodic()
319 if (!canRunInCurrentRunState(true) && remove(task)) in reExecutePeriodic()
320 task.cancel(false); in reExecutePeriodic()
[all …]
DExecutorService.java195 <T> Future<T> submit(Callable<T> task); in submit() argument
209 <T> Future<T> submit(Runnable task, T result); in submit() argument
222 Future<?> submit(Runnable task); in submit() argument
DCompletionService.java44 Future<V> submit(Callable<V> task); in submit() argument
60 Future<V> submit(Runnable task, V result); in submit() argument
DThreadPoolExecutor.java1092 Runnable task = w.firstTask; in runWorker() local
1097 while (task != null || (task = getTask()) != null) { in runWorker()
1109 beforeExecute(wt, task); in runWorker()
1112 task.run(); in runWorker()
1120 afterExecute(task, thrown); in runWorker()
1123 task = null; in runWorker()
1715 public boolean remove(Runnable task) { in remove() argument
1716 boolean removed = workQueue.remove(task); in remove()
DForkJoinTask.java410 ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next) { in ExceptionNode() argument
411 super(task, exceptionTableRefQueue); in ExceptionNode()
/libcore/luni/src/test/java/tests/support/
DThreadPool.java44 public synchronized void runTask(Runnable task) { in runTask() argument
48 if (task != null) { in runTask()
49 taskQueue.add(task); in runTask()
99 Runnable task = null; in run() local
101 task = getTask(); in run()
106 if (task == null) { in run()
112 task.run(); in run()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DTimerTest.java98 private void awaitRun(TimerTestTask task) throws Exception { in awaitRun() argument
99 while (task.wasRun() == 0) { in awaitRun()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/
DSSLEngineTest.java1106 Runnable task; in run() local
1107 while ((task = engine.getDelegatedTask()) != null) { in run()
1108 task.run(); in run()