Home
last modified time | relevance | path

Searched refs:callable (Results 1 – 13 of 13) sorted by relevance

/libcore/luni/src/main/java/java/util/concurrent/
DFutureTask.java45 public FutureTask(Callable<V> callable) { in FutureTask() argument
46 if (callable == null) in FutureTask()
48 sync = new Sync(callable); in FutureTask()
64 sync = new Sync(Executors.callable(runnable, result)); in FutureTask()
174 private final Callable<V> callable; field in FutureTask.Sync
187 Sync(Callable<V> callable) { in Sync() argument
188 this.callable = callable; in Sync()
306 result = callable.call(); in innerRun()
323 callable.call(); // don't set result in innerRunAndReset()
DExecutors.java339 public static <T> Callable<T> callable(Runnable task, T result) { in callable() method in Executors
352 public static Callable<Object> callable(Runnable task) { in callable() method in Executors
365 public static Callable<Object> callable(final PrivilegedAction<?> action) { in callable() method in Executors
380 public static Callable<Object> callable(final PrivilegedExceptionAction<?> action) {
401 public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
402 if (callable == null)
404 return new PrivilegedCallable<T>(callable);
425 public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) {
426 if (callable == null)
428 return new PrivilegedCallableUsingCurrentClassLoader<T>(callable);
[all …]
DScheduledExecutorService.java97 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
DScheduledThreadPoolExecutor.java201 ScheduledFutureTask(Callable<V> callable, long ns) { in ScheduledFutureTask() argument
202 super(callable); in ScheduledFutureTask()
385 Callable<V> callable, RunnableScheduledFuture<V> task) { in decorateTask() argument
509 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
512 if (callable == null || unit == null) in schedule()
514 RunnableScheduledFuture<V> t = decorateTask(callable, in schedule()
515 new ScheduledFutureTask<V>(callable, in schedule()
608 return schedule(Executors.callable(task, result), in submit()
DAbstractExecutorService.java74 protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { in newTaskFor() argument
75 return new FutureTask<T>(callable); in newTaskFor()
/libcore/luni/src/test/java/tests/api/java/util/concurrent/
DExecutorsTest.java182 TrackedCallable callable = new TrackedCallable(); in testNewSingleThreadScheduledExecutor() local
184 Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testNewSingleThreadScheduledExecutor()
185 assertFalse(callable.done); in testNewSingleThreadScheduledExecutor()
187 assertTrue(callable.done); in testNewSingleThreadScheduledExecutor()
196 TrackedCallable callable = new TrackedCallable(); in testnewScheduledThreadPool() local
198 Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testnewScheduledThreadPool()
199 assertFalse(callable.done); in testnewScheduledThreadPool()
201 assertTrue(callable.done); in testnewScheduledThreadPool()
210 TrackedCallable callable = new TrackedCallable(); in testunconfigurableScheduledExecutorService() local
212 Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testunconfigurableScheduledExecutorService()
[all …]
DScheduledExecutorTest.java44 TrackedCallable callable = new TrackedCallable(); in testSchedule1() local
46 Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testSchedule1()
47 assertFalse(callable.done); in testSchedule1()
49 assertTrue(callable.done); in testSchedule1()
158 TrackedCallable callable = null; in testScheduleNull() local
159 Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testScheduleNull()
992 l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
DScheduledExecutorSubclassTest.java97 TrackedCallable callable = new TrackedCallable(); in testSchedule1() local
99 Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testSchedule1()
100 assertFalse(callable.done); in testSchedule1()
102 assertTrue(callable.done); in testSchedule1()
209 TrackedCallable callable = null; in testScheduleNull() local
210 Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testScheduleNull()
1041 l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
DAbstractExecutorServiceTest.java88 Future future = e.submit(Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction()
109 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { in testSubmitPrivilegedExceptionAction()
127 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { in testSubmitFailedPrivilegedExceptionAction()
647 l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); in testTimedInvokeAll6()
DThreadPoolExecutorSubclassTest.java24 final Callable<V> callable; field in ThreadPoolExecutorSubclassTest.CustomTask
34 callable = c; in CustomTask()
38 callable = new Callable<V>() { in CustomTask()
74 v = callable.call(); in run()
1504 l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); in testTimedInvokeAll6()
DThreadPoolExecutorTest.java1375 l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); in testTimedInvokeAll6()
/libcore/luni/src/test/java/sun/misc/
DUnsafeTest.java39 Callable<Object> callable = Executors.callable(new Runnable() { in test_getUnsafeForbiddenWithSystemCaller() local
46 callable.call(); in test_getUnsafeForbiddenWithSystemCaller()
/libcore/support/src/test/java/tests/http/
DMockWebServer.java433 private static <T> Callable<T> namedCallable(final String name, final Callable<T> callable) { in namedCallable() argument
439 return callable.call(); in namedCallable()