public class SuspendableThread extends ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
SuspendableThread(ThreadFactory threadFactory) |
| Modifier and Type | Method and Description |
|---|---|
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, submitpublic SuspendableThread(ThreadFactory threadFactory)
protected void beforeExecute(Thread thread, Runnable task)
beforeExecute in class ThreadPoolExecutorpublic void setAvailable(boolean available)
available - 如果执行器可以执行任务true,否则false .Copyright © 2020. All rights reserved.