Home
last modified time | relevance | path

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

12

/libcore/ojluni/src/main/java/java/util/concurrent/
DFutureTask.java103 private Callable<V> callable; field in FutureTask
133 public FutureTask(Callable<V> callable) { in FutureTask() argument
134 if (callable == null) in FutureTask()
136 this.callable = callable; in FutureTask()
153 this.callable = Executors.callable(runnable, result); in FutureTask()
261 Callable<V> c = callable; in run()
304 Callable<V> c = callable; in runAndReset()
385 callable = null; // to reduce footprint in finishCompletion()
DExecutors.java381 public static <T> Callable<T> callable(Runnable task, T result) { in callable() method in Executors
394 public static Callable<Object> callable(Runnable task) { in callable() method in Executors
407 public static Callable<Object> callable(final PrivilegedAction<?> action) { in callable() method in Executors
422 public static Callable<Object> callable(final PrivilegedExceptionAction<?> action) {
433 public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
434 if (callable == null)
436 return new PrivilegedCallable<T>(callable);
443 public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) {
444 if (callable == null)
446 return new PrivilegedCallableUsingCurrentClassLoader<T>(callable);
[all …]
DScheduledThreadPoolExecutor.java232 ScheduledFutureTask(Callable<V> callable, long triggerTime, in ScheduledFutureTask() argument
234 super(callable); in ScheduledFutureTask()
425 Callable<V> callable, RunnableScheduledFuture<V> task) { in decorateTask() argument
570 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
573 if (callable == null || unit == null) in schedule()
575 RunnableScheduledFuture<V> t = decorateTask(callable, in schedule()
576 new ScheduledFutureTask<V>(callable, in schedule()
672 return schedule(Executors.callable(task, result), 0, NANOSECONDS); in submit()
DForkJoinTask.java1423 final Callable<? extends T> callable; field in ForkJoinTask.AdaptedCallable
1425 AdaptedCallable(Callable<? extends T> callable) { in AdaptedCallable() argument
1426 if (callable == null) throw new NullPointerException(); in AdaptedCallable()
1427 this.callable = callable; in AdaptedCallable()
1433 result = callable.call(); in exec()
1481 public static <T> ForkJoinTask<T> adapt(Callable<? extends T> callable) { in adapt() argument
1482 return new AdaptedCallable<T>(callable); in adapt()
DScheduledExecutorService.java126 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
DAbstractExecutorService.java107 protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { in newTaskFor() argument
108 return new FutureTask<T>(callable); in newTaskFor()
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DForkJoinTaskTest.java60 Callable callable = () -> { return Integer.valueOf(42); }; in testAdaptToCallable() local
61 final ForkJoinTask task = ForkJoinTask.adapt(callable); in testAdaptToCallable()
79 Callable callable = () -> { throw new Exception("Test passed"); }; in testAdaptToCallableThrowsException() local
80 final ForkJoinTask task = ForkJoinTask.adapt(callable); in testAdaptToCallableThrowsException()
/libcore/luni/src/test/java/libcore/sun/misc/
DUnsafeTest.java42 Callable<Object> callable = Executors.callable(new Runnable() { in test_getUnsafeForbiddenWithSystemCaller() local
49 callable.call(); in test_getUnsafeForbiddenWithSystemCaller()
/libcore/jsr166-tests/src/test/java/jsr166/
DExecutorsTest.java211 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testNewSingleThreadScheduledExecutor()
235 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testNewScheduledThreadPool()
261 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testUnconfigurableScheduledExecutorService()
532 Callable c = Executors.callable(new NoOpRunnable()); in testCallable1()
540 Callable c = Executors.callable(new NoOpRunnable(), one); in testCallable2()
548 Callable c = Executors.callable(new PrivilegedAction() { in testCallable3()
557 Callable c = Executors.callable(new PrivilegedExceptionAction() { in testCallable4()
567 Callable c = Executors.callable((Runnable) null); in testCallableNPE1()
577 Callable c = Executors.callable((Runnable) null, one); in testCallableNPE2()
587 Callable c = Executors.callable((PrivilegedAction) null); in testCallableNPE3()
[all …]
DForkJoinPoolTest.java485 final Callable callable = Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction() local
491 Future future = e.submit(callable); in testSubmitPrivilegedAction()
503 final Callable callable = in testSubmitPrivilegedExceptionAction() local
504 Executors.callable(new PrivilegedExceptionAction() { in testSubmitPrivilegedExceptionAction()
510 Future future = e.submit(callable); in testSubmitPrivilegedExceptionAction()
522 final Callable callable = in testSubmitFailedPrivilegedExceptionAction() local
523 Executors.callable(new PrivilegedExceptionAction() { in testSubmitFailedPrivilegedExceptionAction()
529 Future future = e.submit(callable); in testSubmitFailedPrivilegedExceptionAction()
DFutureTaskTest.java196 PublicFutureTask(Callable callable) { in PublicFutureTask() argument
197 this(callable, new AtomicInteger(0)); in PublicFutureTask()
199 private PublicFutureTask(final Callable callable, in PublicFutureTask() argument
204 return callable.call(); in PublicFutureTask()
633 final Callable<Object> callable = in testTimedGet_Cancellation() local
646 final PublicFutureTask task = new PublicFutureTask(callable); in testTimedGet_Cancellation()
DAbstractExecutorServiceTest.java118 Future future = e.submit(Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction()
139 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { in testSubmitPrivilegedExceptionAction()
157 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { in testSubmitFailedPrivilegedExceptionAction()
587 tasks.add(Executors.callable(possiblyInterruptedRunnable(timeout),
DThreadPoolExecutorSubclassTest.java54 final Callable<V> callable; field in ThreadPoolExecutorSubclassTest.CustomTask
64 callable = c; in CustomTask()
68 callable = new Callable<V>() { in CustomTask()
102 v = callable.call(); in run()
DScheduledExecutorSubclassTest.java304 TrackedCallable callable = null; in testScheduleNull() local
305 Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testScheduleNull()
/libcore/ojluni/src/test/java/util/concurrent/tck/
DExecutorsTest.java234 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testNewSingleThreadScheduledExecutor()
258 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testNewScheduledThreadPool()
284 Future f = p.schedule(Executors.callable(task, Boolean.TRUE), in testUnconfigurableScheduledExecutorService()
555 Callable c = Executors.callable(new NoOpRunnable()); in testCallable1()
563 Callable c = Executors.callable(new NoOpRunnable(), one); in testCallable2()
571 Callable c = Executors.callable(new PrivilegedAction() { in testCallable3()
580 Callable c = Executors.callable(new PrivilegedExceptionAction() { in testCallable4()
590 Callable c = Executors.callable((Runnable) null); in testCallableNPE1()
600 Callable c = Executors.callable((Runnable) null, one); in testCallableNPE2()
610 Callable c = Executors.callable((PrivilegedAction) null); in testCallableNPE3()
[all …]
DForkJoinPoolTest.java503 final Callable callable = Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction() local
509 Future future = e.submit(callable); in testSubmitPrivilegedAction()
521 final Callable callable = in testSubmitPrivilegedExceptionAction() local
522 Executors.callable(new PrivilegedExceptionAction() { in testSubmitPrivilegedExceptionAction()
528 Future future = e.submit(callable); in testSubmitPrivilegedExceptionAction()
540 final Callable callable = in testSubmitFailedPrivilegedExceptionAction() local
541 Executors.callable(new PrivilegedExceptionAction() { in testSubmitFailedPrivilegedExceptionAction()
547 Future future = e.submit(callable); in testSubmitFailedPrivilegedExceptionAction()
DFutureTaskTest.java219 PublicFutureTask(Callable callable) { in PublicFutureTask() argument
220 this(callable, new AtomicInteger(0)); in PublicFutureTask()
222 private PublicFutureTask(final Callable callable, in PublicFutureTask() argument
227 return callable.call(); in PublicFutureTask()
656 final Callable<Object> callable = in testTimedGet_Cancellation() local
669 final PublicFutureTask task = new PublicFutureTask(callable); in testTimedGet_Cancellation()
DAbstractExecutorServiceTest.java141 Future future = e.submit(Executors.callable(new PrivilegedAction() { in testSubmitPrivilegedAction()
162 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { in testSubmitPrivilegedExceptionAction()
180 Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() { in testSubmitFailedPrivilegedExceptionAction()
610 tasks.add(Executors.callable(possiblyInterruptedRunnable(timeout),
DThreadPoolExecutorSubclassTest.java76 final Callable<V> callable; field in ThreadPoolExecutorSubclassTest.CustomTask
86 callable = c; in CustomTask()
90 callable = new Callable<V>() { in CustomTask()
124 v = callable.call(); in run()
DScheduledExecutorSubclassTest.java326 TrackedCallable callable = null; in testScheduleNull() local
327 Future f = p.schedule(callable, SHORT_DELAY_MS, MILLISECONDS); in testScheduleNull()
/libcore/luni/src/test/java/libcore/java/lang/
DLambdaImplementationTest.java152 Callable<String> callable = (Callable<String> & Serializable) () -> "No State"; in testSerializableLambda_withoutState() local
153 assertLambdaImplementsInterfaces(callable, Callable.class, Serializable.class); in testSerializableLambda_withoutState()
154 callables.add(callable); in testSerializableLambda_withoutState()
175 Callable<String> callable = (Callable<String> & Serializable) () -> "State:" + state; in testSerializableLambda_withState() local
176 assertLambdaImplementsInterfaces(callable, Callable.class, Serializable.class); in testSerializableLambda_withState()
177 callables.add(callable); in testSerializableLambda_withState()
209 Callable<String> callable = in testMultipleInterfaceLambda() local
211 assertLambdaImplementsInterfaces(callable, Callable.class, MarkerInterface.class); in testMultipleInterfaceLambda()
212 callables.add(callable); in testMultipleInterfaceLambda()
/libcore/ojluni/annotations/hiddenapi/java/util/concurrent/
DExecutors.java120 public static <T> java.util.concurrent.Callable<T> callable(java.lang.Runnable task, T result) { in callable() method in Executors
124 public static java.util.concurrent.Callable<java.lang.Object> callable( in callable() method in Executors
129 public static java.util.concurrent.Callable<java.lang.Object> callable( in callable() method in Executors
134 public static java.util.concurrent.Callable<java.lang.Object> callable( in callable() method in Executors
140 java.util.concurrent.Callable<T> callable) { in privilegedCallable() argument
145 java.util.concurrent.Callable<T> callable) { in privilegedCallableUsingCurrentClassLoader() argument
282 java.util.concurrent.Callable<V> callable, in schedule() argument
DFutureTask.java43 public FutureTask(java.util.concurrent.Callable<V> callable) { in FutureTask() argument
153 private java.util.concurrent.Callable<V> callable; field in FutureTask
/libcore/luni/src/test/java/libcore/libcore/net/
DNetworkSecurityPolicyTest.java258 Callable<byte[]> callable = () -> { in CapturingServerSocket() local
280 mFirstChunkReceivedFuture = executor.submit(callable); in CapturingServerSocket()
/libcore/luni/src/test/java/libcore/java/net/
DURLTest.java189 private static void withCustomURLStreamHandlerFactory(Callable<Void> callable) in withCustomURLStreamHandlerFactory() argument
197 callable.call(); in withCustomURLStreamHandlerFactory()

12