Most visited

Recently visited

Added in API level 1

ThreadPoolExecutor.CallerRunsPolicy

public static class ThreadPoolExecutor.CallerRunsPolicy
extends Object implements RejectedExecutionHandler

java.lang.Object
   ↳ java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy


被拒绝任务的处理程序直接在 execute方法的调用线程中运行被拒绝的任务,除非执行程序已关闭,在这种情况下任务将被丢弃。

Summary

Public constructors

ThreadPoolExecutor.CallerRunsPolicy()

创建一个 CallerRunsPolicy 。

Public methods

void rejectedExecution(Runnable r, ThreadPoolExecutor e)

在调用者的线程中执行任务r,除非执行程序已关闭,在这种情况下任务将被丢弃。

Inherited methods

From class java.lang.Object
From interface java.util.concurrent.RejectedExecutionHandler

Public constructors

ThreadPoolExecutor.CallerRunsPolicy

Added in API level 1
ThreadPoolExecutor.CallerRunsPolicy ()

创建一个 CallerRunsPolicy 。

Public methods

rejectedExecution

Added in API level 1
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

Hooray!