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