mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved for create scheduler
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user