Top Description Inners Fields Constructors Methods
org.jboss.threads

public final Class ManagedThreadPoolExecutor

extends ThreadPoolExecutor
implements ManageableThreadPoolExecutorService
Class Inheritance
All Implemented Interfaces
org.jboss.threads.management.ManageableThreadPoolExecutorService, java.util.concurrent.ExecutorService, java.lang.AutoCloseable, java.util.concurrent.Executor
Imports
java.util.concurrent.BlockingQueue, .Executor, .RejectedExecutionHandler, .ThreadFactory, .ThreadPoolExecutor, .TimeUnit, org.jboss.threads.management.ManageableThreadPoolExecutorService, .StandardThreadPoolMXBean, org.wildfly.common.Assert

A version of ThreadPoolExecutor which implements ManageableThreadPoolExecutorService in order to allow opting out of using EnhancedQueueExecutor.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private static final RejectedExecutionHandler
private volatile Executor
private final StandardThreadPoolMXBean
private final Runnable

Constructor Summary

AccessConstructor and Description
public
ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Runnable terminationTask)

public
ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Runnable terminationTask)

public
ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Executor handoffExecutor, final Runnable terminationTask)

public
ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Executor handoffExecutor, final Runnable terminationTask)

Method Summary

Modifier and TypeMethod and Description
public Executor
public StandardThreadPoolMXBean
getThreadPoolMXBean()

Implements org.jboss.threads.management.ManageableThreadPoolExecutorService.getThreadPoolMXBean.

Create or acquire an MXBean instance for this thread pool.
pack-priv void
reject(Runnable r)

Hides java.util.concurrent.ThreadPoolExecutor.reject.

Invokes the rejected execution handler for the given command.
public void
setHandoffExecutor(final Executor handoffExecutor)

protected void
terminated()

Overrides java.util.concurrent.ThreadPoolExecutor.terminated.

Method invoked when the Executor has terminated.
Inherited from java.util.concurrent.ThreadPoolExecutor:
afterExecuteallowCoreThreadTimeOutallowsCoreThreadTimeOutawaitTerminationbeforeExecuteexecutefinalizegetActiveCountgetCompletedTaskCountgetCorePoolSizegetKeepAliveTimegetLargestPoolSizegetMaximumPoolSizegetPoolSizegetQueuegetRejectedExecutionHandlergetTaskCountgetThreadFactoryisShutdownisTerminatedisTerminatingprestartAllCoreThreadsprestartCoreThreadpurgeremovesetCorePoolSizesetKeepAliveTimesetMaximumPoolSizesetRejectedExecutionHandlersetThreadFactoryshutdownshutdownNowtoString

Field Detail

HANDLERback to summary
private static final RejectedExecutionHandler HANDLER
handoffExecutorback to summary
private volatile Executor handoffExecutor
mxBeanback to summary
private final StandardThreadPoolMXBean mxBean
terminationTaskback to summary
private final Runnable terminationTask

Constructor Detail

ManagedThreadPoolExecutorback to summary
public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Runnable terminationTask)
ManagedThreadPoolExecutorback to summary
public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Runnable terminationTask)
ManagedThreadPoolExecutorback to summary
public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final Executor handoffExecutor, final Runnable terminationTask)
ManagedThreadPoolExecutorback to summary
public ManagedThreadPoolExecutor(final int corePoolSize, final int maximumPoolSize, final long keepAliveTime, final TimeUnit unit, final BlockingQueue<Runnable> workQueue, final ThreadFactory threadFactory, final Executor handoffExecutor, final Runnable terminationTask)

Method Detail

getHandoffExecutorback to summary
public Executor getHandoffExecutor()
getThreadPoolMXBeanback to summary
public StandardThreadPoolMXBean getThreadPoolMXBean()

Implements org.jboss.threads.management.ManageableThreadPoolExecutorService.getThreadPoolMXBean.

Doc from org.jboss.threads.management.ManageableThreadPoolExecutorService.getThreadPoolMXBean.

Create or acquire an MXBean instance for this thread pool. Note that the thread pool itself will not do anything in particular to register (or unregister) the MXBean with a JMX server; that is the caller's responsibility.

Returns:StandardThreadPoolMXBean

the MXBean instance (must not be null)

rejectback to summary
pack-priv void reject(Runnable r)

Hides java.util.concurrent.ThreadPoolExecutor.reject.

Doc from java.util.concurrent.ThreadPoolExecutor.reject.

Invokes the rejected execution handler for the given command. Package-protected for use by ScheduledThreadPoolExecutor.

setHandoffExecutorback to summary
public void setHandoffExecutor(final Executor handoffExecutor)
terminatedback to summary
protected void terminated()

Overrides java.util.concurrent.ThreadPoolExecutor.terminated.

Doc from java.util.concurrent.ThreadPoolExecutor.terminated.

Method invoked when the Executor has terminated. Default implementation does nothing.

Note

To properly nest multiple overridings, subclasses should generally invoke super.terminated within this method.

org.jboss.threads back to summary

pack-priv Class ManagedThreadPoolExecutor.MXBeanImpl

extends Object
implements StandardThreadPoolMXBean
Class Inheritance
All Implemented Interfaces
org.jboss.threads.management.StandardThreadPoolMXBean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
getActiveCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getActiveCount.

Get an estimate of the current number of active (busy) threads.
public long
getCompletedTaskCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getCompletedTaskCount.

Get an estimate of the number of tasks completed by this thread pool.
public int
public float
public long
public int
getLargestPoolSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getLargestPoolSize.

Get an estimate of the peak number of threads that the pool has ever held.
public int
getLargestQueueSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getLargestQueueSize.

Get an estimate of the peak size of the queue, if any.
public int
public int
getMaximumQueueSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getMaximumQueueSize.

Get the maximum queue size for this thread pool.
public int
getPoolSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getPoolSize.

Get an estimate of the current number of active threads in the pool.
public int
getQueueSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getQueueSize.

Get an estimate of the current queue size, if any.
public long
getRejectedTaskCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getRejectedTaskCount.

Get an estimate of the total number of tasks ever rejected by this thread pool for any reason.
public long
getSubmittedTaskCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getSubmittedTaskCount.

Get an estimate of the total number of tasks ever submitted to this thread pool.
public boolean
isAllowCoreThreadTimeOut()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isAllowCoreThreadTimeOut.

Determine whether core threads are allowed to time out.
public boolean
isCorePoolSizeSupported()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isCorePoolSizeSupported.

Determine whether this implementation supports a separate core pool size.
public boolean
isCoreThreadPrestartSupported()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isCoreThreadPrestartSupported.

Determine whether this thread pool allows manual pre-start of core threads.
public boolean
isGrowthResistanceSupported()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isGrowthResistanceSupported.

Determine whether the thread pool supports a growth resistance factor.
public boolean
isQueueBounded()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isQueueBounded.

Determine whether there is a bounded queue backing this thread pool.
public boolean
isQueueSizeModifiable()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isQueueSizeModifiable.

Determine whether the maximum queue size is modifiable.
public boolean
isShutdown()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isShutdown.

Determine whether shutdown was requested.
public boolean
isTerminated()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isTerminated.

Determine whether shutdown is complete.
public boolean
isTerminating()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isTerminating.

Determine whether shutdown is in progress.
public int
public boolean
prestartCoreThread()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.prestartCoreThread.

Attempt to start a core thread without submitting work to it.
public void
setAllowCoreThreadTimeOut(final boolean
true if core threads are allowed to time out, false otherwise
value
)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setAllowCoreThreadTimeOut.

Establish whether core threads are allowed to time out.
public void
setCorePoolSize(final int
the core pool size (must be greater than or equal to 0)
corePoolSize
)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setCorePoolSize.

Set the core pool size.
public void
setGrowthResistance(final float
the growth resistance factor (0.0 ≤ n ≤ 1.0)
value
)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setGrowthResistance.

Set the pool size growth resistance factor, if supported.
public void
setKeepAliveTimeSeconds(final long
the thread keep-alive time, in seconds (must be greater than or equal to 0)
seconds
)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setKeepAliveTimeSeconds.

Set the thread keep-alive time, in seconds.
public void
setMaximumPoolSize(final int
the maximum pool size (must be greater than or equal to 0)
maxPoolSize
)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setMaximumPoolSize.

Set the maximum pool size.
public void
setMaximumQueueSize(final int
the maximum queue size for this thread pool
size
)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setMaximumQueueSize.

Set the maximum queue size for this thread pool.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MXBeanImplback to summary
pack-priv MXBeanImpl()

Method Detail

getActiveCountback to summary
public int getActiveCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getActiveCount.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getActiveCount.

Get an estimate of the current number of active (busy) threads.

Returns:int

an estimate of the active count

getCompletedTaskCountback to summary
public long getCompletedTaskCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getCompletedTaskCount.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getCompletedTaskCount.

Get an estimate of the number of tasks completed by this thread pool. This number may be zero if the underlying thread pool does not support this metric.

Returns:long

an estimate of the number of tasks completed by this thread pool

getCorePoolSizeback to summary
public int getCorePoolSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getCorePoolSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getCorePoolSize.

Get the core pool size. This is the size below which new threads will always be created if no idle threads are available. If the thread pool does not support a separate core pool size, this size will match the maximum size.

Returns:int

the core pool size

getGrowthResistanceback to summary
public float getGrowthResistance()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getGrowthResistance.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getGrowthResistance.

Get the pool size growth resistance factor. If the thread pool does not support growth resistance, then 0.0 (no resistance) is returned.

Returns:float

the growth resistance factor (0.0 ≤ n ≤ 1.0)

getKeepAliveTimeSecondsback to summary
public long getKeepAliveTimeSeconds()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getKeepAliveTimeSeconds.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getKeepAliveTimeSeconds.

Get the thread keep-alive time, in seconds.

This method differs from the typical getKeepAliveTime(TimeUnit) due to the inability to send in a time units parameter on an MXBean attribute. As such, the unit is hard-coded to seconds.

Returns:long

the thread keep-alive time, in seconds

getLargestPoolSizeback to summary
public int getLargestPoolSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getLargestPoolSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getLargestPoolSize.

Get an estimate of the peak number of threads that the pool has ever held.

Returns:int

an estimate of the peak number of threads that the pool has ever held

getLargestQueueSizeback to summary
public int getLargestQueueSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getLargestQueueSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getLargestQueueSize.

Get an estimate of the peak size of the queue, if any. If no backing queue exists, or its size cannot be determined, this method will return 0.

Returns:int

an estimate of the peak size of the queue

getMaximumPoolSizeback to summary
public int getMaximumPoolSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getMaximumPoolSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getMaximumPoolSize.

Get the maximum pool size. This is the absolute upper limit to the size of the thread pool.

Returns:int

the maximum pool size

getMaximumQueueSizeback to summary
public int getMaximumQueueSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getMaximumQueueSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getMaximumQueueSize.

Get the maximum queue size for this thread pool. If there is no queue or it is not bounded, Integer#MAX_VALUE is returned.

Returns:int

the maximum queue size

getPoolSizeback to summary
public int getPoolSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getPoolSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getPoolSize.

Get an estimate of the current number of active threads in the pool.

Returns:int

an estimate of the current number of active threads in the pool

getQueueSizeback to summary
public int getQueueSize()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getQueueSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getQueueSize.

Get an estimate of the current queue size, if any. If no backing queue exists, or its size cannot be determined, this method will return 0.

Returns:int

an estimate of the current queue size

getRejectedTaskCountback to summary
public long getRejectedTaskCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getRejectedTaskCount.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getRejectedTaskCount.

Get an estimate of the total number of tasks ever rejected by this thread pool for any reason. This number may be zero if the underlying thread pool does not support this metric.

Returns:long

an estimate of the total number of tasks ever rejected by this thread pool

getSubmittedTaskCountback to summary
public long getSubmittedTaskCount()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.getSubmittedTaskCount.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.getSubmittedTaskCount.

Get an estimate of the total number of tasks ever submitted to this thread pool. This number may be zero if the underlying thread pool does not support this metric.

Returns:long

an estimate of the total number of tasks ever submitted to this thread pool

isAllowCoreThreadTimeOutback to summary
public boolean isAllowCoreThreadTimeOut()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isAllowCoreThreadTimeOut.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isAllowCoreThreadTimeOut.

Determine whether core threads are allowed to time out. A "core thread" is defined as any thread in the pool when the pool size is below the pool's core pool size. If the thread pool does not support a separate core pool size, this method should return false.

This method is named differently from the typical allowsCoreThreadTimeOut() in order to accommodate the requirements of MXBean attribute methods.

Returns:boolean

true if core threads are allowed to time out, false otherwise

isCorePoolSizeSupportedback to summary
public boolean isCorePoolSizeSupported()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isCorePoolSizeSupported.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isCorePoolSizeSupported.

Determine whether this implementation supports a separate core pool size.

Returns:boolean

true if a separate core size is supported; false otherwise

isCoreThreadPrestartSupportedback to summary
public boolean isCoreThreadPrestartSupported()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isCoreThreadPrestartSupported.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isCoreThreadPrestartSupported.

Determine whether this thread pool allows manual pre-start of core threads.

Returns:boolean

true if pre-starting core threads is supported, false otherwise

isGrowthResistanceSupportedback to summary
public boolean isGrowthResistanceSupported()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isGrowthResistanceSupported.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isGrowthResistanceSupported.

Determine whether the thread pool supports a growth resistance factor.

Returns:boolean

true if the growth resistance factor is supported, false otherwise

isQueueBoundedback to summary
public boolean isQueueBounded()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isQueueBounded.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isQueueBounded.

Determine whether there is a bounded queue backing this thread pool.

Returns:boolean

true if there is a bounded backing queue, false otherwise

isQueueSizeModifiableback to summary
public boolean isQueueSizeModifiable()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isQueueSizeModifiable.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isQueueSizeModifiable.

Determine whether the maximum queue size is modifiable.

Returns:boolean

true if the queue size is modifiable, false otherwise

isShutdownback to summary
public boolean isShutdown()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isShutdown.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isShutdown.

Determine whether shutdown was requested.

Returns:boolean

true if shutdown was requested, false otherwise

isTerminatedback to summary
public boolean isTerminated()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isTerminated.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isTerminated.

Determine whether shutdown is complete.

Returns:boolean

true if shutdown is complete, false otherwise

isTerminatingback to summary
public boolean isTerminating()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.isTerminating.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.isTerminating.

Determine whether shutdown is in progress.

Returns:boolean

true if shutdown is in progress, false otherwise

prestartAllCoreThreadsback to summary
public int prestartAllCoreThreads()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.prestartAllCoreThreads.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.prestartAllCoreThreads.

Attempt to start all core threads. This is usually equivalent to calling prestartCoreThread() in a loop until it returns false and counting the true results.

Returns:int

the number of started core threads (may be 0)

prestartCoreThreadback to summary
public boolean prestartCoreThread()

Implements org.jboss.threads.management.StandardThreadPoolMXBean.prestartCoreThread.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.prestartCoreThread.

Attempt to start a core thread without submitting work to it.

Returns:boolean

true if the thread was started, or false if the pool is filled to the core size, the thread could not be created, or prestart of core threads is not supported.

setAllowCoreThreadTimeOutback to summary
public void setAllowCoreThreadTimeOut(final boolean value)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setAllowCoreThreadTimeOut.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.setAllowCoreThreadTimeOut.

Establish whether core threads are allowed to time out. A "core thread" is defined as any thread in the pool when the pool size is below the pool's core pool size. If the thread pool does not support a separate core pool size, the value is ignored.

This method is named differently from the typical allowCoreThreadTimeOut(boolean) in order to accommodate the requirements of MXBean attribute methods.

Parameters
value:boolean

true if core threads are allowed to time out, false otherwise

setCorePoolSizeback to summary
public void setCorePoolSize(final int corePoolSize)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setCorePoolSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.setCorePoolSize.

Set the core pool size. If the configured maximum pool size is less than the configured core size, the core size will be reduced to match the maximum size when the thread pool is constructed. If the thread pool does not support a separate core pool size, this setting will be ignored.

Parameters
corePoolSize:int

the core pool size (must be greater than or equal to 0)

setGrowthResistanceback to summary
public void setGrowthResistance(final float value)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setGrowthResistance.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.setGrowthResistance.

Set the pool size growth resistance factor, if supported.

Parameters
value:float

the growth resistance factor (0.0 ≤ n ≤ 1.0)

setKeepAliveTimeSecondsback to summary
public void setKeepAliveTimeSeconds(final long seconds)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setKeepAliveTimeSeconds.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.setKeepAliveTimeSeconds.

Set the thread keep-alive time, in seconds.

This method differs from the typical getKeepAliveTime(TimeUnit) due to the inability to send in a time units parameter on an MXBean attribute. As such, the unit is hard-coded to seconds.

Parameters
seconds:long

the thread keep-alive time, in seconds (must be greater than or equal to 0)

setMaximumPoolSizeback to summary
public void setMaximumPoolSize(final int maxPoolSize)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setMaximumPoolSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.setMaximumPoolSize.

Set the maximum pool size. If the configured maximum pool size is less than the configured core size, the core size will be reduced to match the maximum size when the thread pool is constructed.

Parameters
maxPoolSize:int

the maximum pool size (must be greater than or equal to 0)

setMaximumQueueSizeback to summary
public void setMaximumQueueSize(final int size)

Implements org.jboss.threads.management.StandardThreadPoolMXBean.setMaximumQueueSize.

Doc from org.jboss.threads.management.StandardThreadPoolMXBean.setMaximumQueueSize.

Set the maximum queue size for this thread pool. If the new maximum queue size is smaller than the current queue size, there is no effect other than preventing tasks from being enqueued until the size decreases below the maximum again. If changing the maximum queue size is not supported, or there is no bounded backing queue, then the value is ignored.

Parameters
size:int

the maximum queue size for this thread pool