|
|
@ -619,6 +619,8 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkThread() throws SQLException { |
|
|
|
private void checkThread() throws SQLException { |
|
|
|
|
|
|
|
if (!createConnectionThread.isStarted() && !destroyConnectionThread.isStarted()) { |
|
|
|
|
|
|
|
synchronized (this) {//线程安全问题,加个双检锁
|
|
|
|
if (!createConnectionThread.isStarted() && !destroyConnectionThread.isStarted()) { |
|
|
|
if (!createConnectionThread.isStarted() && !destroyConnectionThread.isStarted()) { |
|
|
|
createConnectionThread.setStarted(true); |
|
|
|
createConnectionThread.setStarted(true); |
|
|
|
createConnectionThread.start(); |
|
|
|
createConnectionThread.start(); |
|
|
@ -631,6 +633,8 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void init() throws SQLException { |
|
|
|
public void init() throws SQLException { |
|
|
|
if (inited) { |
|
|
|
if (inited) { |
|
|
|