本文整理了Java中org.jboss.threads.QueueExecutor.setMaxThreads
方法的一些代码示例,展示了QueueExecutor.setMaxThreads
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueueExecutor.setMaxThreads
方法的具体详情如下:
包路径:org.jboss.threads.QueueExecutor
类名称:QueueExecutor
方法名:setMaxThreads
暂无
代码示例来源:origin: wildfly/wildfly
/** {@inheritDoc} */
public void setCoreThreads(final int coreThreads) {
final Lock lock = this.lock;
lock.lock();
try {
final int oldLimit = this.coreThreads;
if (maxThreads < coreThreads) {
// don't let the max thread limit be less than the core thread limit.
// the called method will signal as needed
setMaxThreads(coreThreads);
} else if (oldLimit < coreThreads) {
// we're growing the number of core threads
// therefore signal anyone waiting to add tasks; there might be more threads to add
removeCondition.signalAll();
} else if (oldLimit > coreThreads) {
// we're shrinking the number of core threads
// therefore signal anyone waiting to remove tasks so the pool can shrink properly
enqueueCondition.signalAll();
} else {
// we aren't changing anything...
return;
}
this.coreThreads = coreThreads;
} finally {
lock.unlock();
}
}
代码示例来源:origin: wildfly/wildfly-core
void setMaxThreads(int maxThreads) {
executor.setMaxThreads(maxThreads);
}
代码示例来源:origin: org.jboss.threads/jboss-threads
/** {@inheritDoc} */
public void setCoreThreads(final int coreThreads) {
final Lock lock = this.lock;
lock.lock();
try {
final int oldLimit = this.coreThreads;
if (maxThreads < coreThreads) {
// don't let the max thread limit be less than the core thread limit.
// the called method will signal as needed
setMaxThreads(coreThreads);
} else if (oldLimit < coreThreads) {
// we're growing the number of core threads
// therefore signal anyone waiting to add tasks; there might be more threads to add
removeCondition.signalAll();
} else if (oldLimit > coreThreads) {
// we're shrinking the number of core threads
// therefore signal anyone waiting to remove tasks so the pool can shrink properly
enqueueCondition.signalAll();
} else {
// we aren't changing anything...
return;
}
this.coreThreads = coreThreads;
} finally {
lock.unlock();
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/** {@inheritDoc} */
public void setCoreThreads(final int coreThreads) {
final Lock lock = this.lock;
lock.lock();
try {
final int oldLimit = this.coreThreads;
if (maxThreads < coreThreads) {
// don't let the max thread limit be less than the core thread limit.
// the called method will signal as needed
setMaxThreads(coreThreads);
} else if (oldLimit < coreThreads) {
// we're growing the number of core threads
// therefore signal anyone waiting to add tasks; there might be more threads to add
removeCondition.signalAll();
} else if (oldLimit > coreThreads) {
// we're shrinking the number of core threads
// therefore signal anyone waiting to remove tasks so the pool can shrink properly
enqueueCondition.signalAll();
} else {
// we aren't changing anything...
return;
}
this.coreThreads = coreThreads;
} finally {
lock.unlock();
}
}
内容来源于网络,如有侵权,请联系作者删除!