improved for create scheduler

This commit is contained in:
shaojin.wensj
2015-06-28 17:49:44 +08:00
parent 5d0a350e5c
commit cd260f2613
2 changed files with 6 additions and 7 deletions
@@ -240,7 +240,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
protected DruidDataSourceStatLogger statLogger = new DruidDataSourceStatLoggerImpl();
private boolean asyncCloseConnectionEnable = false;
protected int maxCreateTaskCount = 2;
protected int maxCreateTaskCount = 3;
protected ScheduledExecutorService destroyScheduler;
protected ScheduledExecutorService createScheduler;
@@ -1762,14 +1762,13 @@ public class DruidDataSource extends DruidAbstractDataSource
@Override
public void run() {
runInternal();
}
private void runInternal() {
for (;;) {
// addLast
try {
lock.lockInterruptibly();
} catch (InterruptedException e2) {
break;
}
lock.lock();
try {
// 必须存在线程等待,才创建连接
if (poolingCount >= notEmptyWaitThreadCount) {