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 |
|
---|---|
From class java.lang.Object
|
|
From interface 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 |