RejectedExecutionHandlerpublic static class ThreadPoolExecutor.CallerRunsPolicy extends Object implements RejectedExecutionHandler
execute method,
unless the executor has been shut down, in which case the task
is discarded.| 构造器 | 说明 |
|---|---|
CallerRunsPolicy() |
Creates a
CallerRunsPolicy. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
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.
|
public void rejectedExecution(Runnable r, ThreadPoolExecutor e)
rejectedExecution 在接口中 RejectedExecutionHandlerr - the runnable task requested to be executede - the executor attempting to execute this task