public class SynThreadPoolExecutor extends ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
SynThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> runnableQueue,
ThreadFactory threadFactory) |
SynThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> runnableQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler rejectedExecutionHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable runnable) |
<R> Future<R> |
submit(Runnable runnable,
R result) |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, submitpublic SynThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> runnableQueue,
ThreadFactory threadFactory)
corePoolSize - corePoolSizemaximumPoolSize - maximumPoolSizekeepAliveTime - 单位: 秒runnableQueue - runnableQueuethreadFactory - threadFactorypublic SynThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
BlockingQueue<Runnable> runnableQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler rejectedExecutionHandler)
corePoolSize - corePoolSizemaximumPoolSize - maximumPoolSizekeepAliveTime - keepAliveTimerunnableQueue - runnableQueuethreadFactory - threadFactoryrejectedExecutionHandler - rejectedExecutionHandlerpublic void execute(Runnable runnable)
execute in interface Executorexecute in class ThreadPoolExecutorpublic <R> Future<R> submit(Runnable runnable, R result)
submit in interface ExecutorServicesubmit in class AbstractExecutorServiceCopyright © 2025. All rights reserved.