class SuspendableThreadPoolExecutor extends ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| 限定符和类型 | 字段和说明 |
|---|---|
private boolean |
available |
private Condition |
availableCondition |
private ReentrantLock |
suspendLock |
| 构造器和说明 |
|---|
SuspendableThreadPoolExecutor(ThreadFactory threadFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
beforeExecute(Thread thread,
Runnable task) |
void |
setAvailable(boolean available) |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitprivate boolean available
private ReentrantLock suspendLock
private Condition availableCondition
public SuspendableThreadPoolExecutor(ThreadFactory threadFactory)
protected void beforeExecute(Thread thread, Runnable task)
beforeExecute 在类中 ThreadPoolExecutorpublic void setAvailable(boolean available)
Copyright © 2020. All rights reserved.