ThreadPoolExecutor

1.拒绝策略 接口: public interface RejectedExecutionHandler { void rejectedExecution(Runnable r, ThreadPoolExecutor executor); } 实现: 1.AbortPolicy 策略,直接抛出异常; 2.CallerRunsPolicy 策略 只要线程池未关闭,直接在调用者线程中,运行当前被丢弃的
相关文章
相关标签/搜索