Home
last modified time | relevance | path

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

12

/libcore/luni/src/test/java/libcore/java/util/concurrent/
DFutureTaskTest.java38 TestCallable callable = new TestCallable(); in testRecursiveToString() local
39 FutureTask task = new FutureTask(callable); in testRecursiveToString()
40 callable.set(task); in testRecursiveToString()
42 assertFalse(callable.hasDetectedRecursiveToString()); in testRecursiveToString()
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/ojluni/src/main/java/java/util/concurrent/
DFutureTask.java102 private Callable<V> callable; field in FutureTask
132 public FutureTask(Callable<V> callable) { in FutureTask() argument
133 if (callable == null) in FutureTask()
135 this.callable = callable; in FutureTask()
152 this.callable = Executors.callable(runnable, result); in FutureTask()
259 Callable<V> c = callable; in run()
302 Callable<V> c = callable; in runAndReset()
383 callable = null; // to reduce footprint in finishCompletion()
DExecutors.java390 public static <T> Callable<T> callable(Runnable task, T result) { in callable() method in Executors
403 public static Callable<Object> callable(Runnable task) { in callable() method in Executors
416 public static Callable<Object> callable(final PrivilegedAction<?> action) { in callable() method in Executors
431 public static Callable<Object> callable(final PrivilegedExceptionAction<?> action) {
450 public static <T> Callable<T> privilegedCallable(Callable<T> callable) {
451 if (callable == null)
453 return new PrivilegedCallable<T>(callable);
468 public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) {
469 if (callable == null)
471 return new PrivilegedCallableUsingCurrentClassLoader<T>(callable);
[all …]
DForkJoinTask.java1422 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()
1443 return super.toString() + "[Wrapped task = " + callable + "]"; in toString()
1451 final Callable<? extends T> callable; field in ForkJoinTask.AdaptedInterruptibleCallable
1455 AdaptedInterruptibleCallable(Callable<? extends T> callable) { in AdaptedInterruptibleCallable() argument
1456 if (callable == null) throw new NullPointerException(); in AdaptedInterruptibleCallable()
1457 this.callable = callable; in AdaptedInterruptibleCallable()
[all …]
DScheduledThreadPoolExecutor.java239 ScheduledFutureTask(Callable<V> callable, long triggerTime, in ScheduledFutureTask() argument
241 super(callable); in ScheduledFutureTask()
432 Callable<V> callable, RunnableScheduledFuture<V> task) { in decorateTask() argument
577 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
580 if (callable == null || unit == null) in schedule()
582 RunnableScheduledFuture<V> t = decorateTask(callable, in schedule()
583 new ScheduledFutureTask<V>(callable, in schedule()
730 return schedule(Executors.callable(task, result), 0, NANOSECONDS); in submit()
DScheduledExecutorService.java122 public <V> ScheduledFuture<V> schedule(Callable<V> callable, in schedule() argument
DAbstractExecutorService.java112 protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { in newTaskFor() argument
113 return new FutureTask<T>(callable); in newTaskFor()
DForkJoinPool.java2820 final Callable<E> callable;
2822 InvokeAnyTask(InvokeAnyRoot<E> root, Callable<E> callable) {
2824 this.callable = callable;
2829 root.tryComplete(callable);
3479 protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {
3480 return new ForkJoinTask.AdaptedCallable<T>(callable);
/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()
/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()
/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/ojluni/src/test/java/lang/invoke/
DInvokeGenericTest.java305 MethodHandle callable(List<Class<?>> params) { in callable() method in InvokeGenericTest
313 MethodHandle callable(Class<?>... params) { in callable() method in InvokeGenericTest
314 return callable(Arrays.asList(params)); in callable()
336 MethodHandle mh = callable(Object.class, String.class); in testSimple()
348 MethodHandle mh = callable(Object.class, Object.class); in testSimplePrims()
360 MethodHandle mh = callable(Object.class, String.class); in testAlternateName()
394 MethodHandle target = callable(expect); in testWrongArgumentCount()
472 MethodHandle mh = callable(type.parameterList()); in testReferenceConversions()
507 MethodHandle mh = callable(Object.class, int.class); in testBoxConversions()
/libcore/luni/src/test/java/libcore/sun/misc/
DUnsafeTest.java44 Callable<Object> callable = Executors.callable(new Runnable() { in test_getUnsafeForbiddenWithSystemCaller() local
51 callable.call(); in test_getUnsafeForbiddenWithSystemCaller()
/libcore/luni/src/test/java/libcore/libcore/net/
DNetworkSecurityPolicyTest.java258 Callable<byte[]> callable = () -> { in CapturingServerSocket() local
280 mFirstChunkReceivedFuture = executor.submit(callable); in CapturingServerSocket()

12