/libcore/luni/src/main/java/java/util/concurrent/ |
D | FutureTask.java | 45 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()
|
D | Executors.java | 339 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 …]
|
D | ScheduledExecutorService.java | 97 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
|
D | ScheduledThreadPoolExecutor.java | 201 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()
|
D | AbstractExecutorService.java | 74 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/ |
D | ExecutorsTest.java | 182 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 …]
|
D | ScheduledExecutorTest.java | 44 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));
|
D | ScheduledExecutorSubclassTest.java | 97 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));
|
D | AbstractExecutorServiceTest.java | 88 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()
|
D | ThreadPoolExecutorSubclassTest.java | 24 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()
|
D | ThreadPoolExecutorTest.java | 1375 l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING)); in testTimedInvokeAll6()
|
/libcore/luni/src/test/java/sun/misc/ |
D | UnsafeTest.java | 39 Callable<Object> callable = Executors.callable(new Runnable() { in test_getUnsafeForbiddenWithSystemCaller() local 46 callable.call(); in test_getUnsafeForbiddenWithSystemCaller()
|
/libcore/support/src/test/java/tests/http/ |
D | MockWebServer.java | 433 private static <T> Callable<T> namedCallable(final String name, final Callable<T> callable) { in namedCallable() argument 439 return callable.call(); in namedCallable()
|