public static class ThreadPoolExecutor.CallerRunsPolicy
extends Object implements RejectedExecutionHandler
| java.lang.Object | |
| java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy | |
被拒绝任务的处理程序直接在 execute方法的调用线程中运行被拒绝的任务,除非执行程序已关闭,在这种情况下任务将被丢弃。
Public constructors |
|
|---|---|
ThreadPoolExecutor.CallerRunsPolicy() 创建一个 |
|
公共方法(Public methods) |
|
|---|---|
void |
rejectedExecution(Runnable r, ThreadPoolExecutor e) 在调用者的线程中执行任务r,除非执行程序已关闭,在这种情况下任务将被丢弃。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
java.util.concurrent.RejectedExecutionHandler
|
|
ThreadPoolExecutor.CallerRunsPolicy ()
创建一个 CallerRunsPolicy 。
void rejectedExecution (Runnable r, ThreadPoolExecutor e)
在调用者的线程中执行任务r,除非执行程序已关闭,在这种情况下任务将被丢弃。
| 参数(Parameters) | |
|---|---|
r |
Runnable: the runnable task requested to be executed |
e |
ThreadPoolExecutor: the executor attempting to execute this task |