public final class RunAndWaitUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <R> R |
runAndWait(Object pCurrentThreadId,
Object pDestThreadId,
Consumer<Runnable> pRunOnThread,
Callable<R> pCallable)
Runs the specified callable on the specified thread and waits for the result.
|
public static <R> R runAndWait(Object pCurrentThreadId, Object pDestThreadId, Consumer<Runnable> pRunOnThread, Callable<R> pCallable) throws Exception
pCurrentThreadId
- The ID of the current thread.pDestThreadId
- The ID of the thread on which
the specified callable should be executed.pRunOnThread
- Consumer which executes (without waiting)
the specified runnable on the thread with ID pDestThreadId
.pCallable
- The callable to be run on the thread with ID pDestThreadId
.Exception
Copyright © 2023. All rights reserved.