
Public Member Functions | |
| void | run () |
Package Functions | |
| TaskWrapper (Runnable delegate) | |
| boolean | isRunning () |
| void | attemptCancelTask () |
| boolean | awaitTaskFinish (long timeout, TimeUnit unit) throws InterruptedException |
Private Attributes | |
| final Runnable | delegate |
| final ReentrantLock | runLock |
| volatile boolean | isRunning |
Wrapper of the user-supplied Runnable, which can inform callers about the execution status of the run() method, or block clients until it finishes.
| alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::TaskWrapper | ( | Runnable | delegate | ) | [inline, package] |
References isRunning(), and runLock.
| void alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::attemptCancelTask | ( | ) | [inline, package] |
Checks if the delegate Runnable is of subtype CancelableRunnable, and if so, calls the cancel() method.
References delegate.
Referenced by alma::acs::concurrent::ThreadLoopRunner::shutdown().
| boolean alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::awaitTaskFinish | ( | long | timeout, | |
| TimeUnit | unit | |||
| ) | throws InterruptedException [inline, package] |
Blocks the calling thread if and as long as the delegate::run method executes, but at most for the given timeout.
| InterruptedException |
References runLock.
Referenced by alma::acs::concurrent::ThreadLoopRunner::suspendLoopAndWait().
| boolean alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::isRunning | ( | ) | [inline, package] |
| void alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::run | ( | ) | [inline] |
References delegate, isRunning(), and runLock.
final Runnable alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::delegate [private] |
Referenced by attemptCancelTask(), and run().
volatile boolean alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::isRunning [private] |
Referenced by alma::acs::concurrent::ThreadLoopRunner::isTaskRunning().
final ReentrantLock alma::acs::concurrent::ThreadLoopRunner::TaskWrapper::runLock [private] |
Referenced by awaitTaskFinish(), run(), and TaskWrapper().
1.6.2