edu.emory.mathcs.backport.java.util.concurrent
Class ThreadPoolExecutor.CallerRunsPolicy
java.lang.Object
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy
- ThreadPoolExecutor
- RejectedExecutionHandler
public static class ThreadPoolExecutor.CallerRunsPolicy
extends java.lang.Object
A handler for rejected tasks that runs the rejected task
directly in the calling thread of the execute method,
unless the executor has been shut down, in which case the task
is discarded.
CallerRunsPolicy
public CallerRunsPolicy()
Creates a CallerRunsPolicy.
rejectedExecution
public void rejectedExecution(Runnable r,
ThreadPoolExecutor e)
Executes task r in the caller's thread, unless the executor
has been shut down, in which case the task is discarded.
- rejectedExecution in interface RejectedExecutionHandler
r
- the runnable task requested to be executede
- the executor attempting to execute this task