Browse Source

中断废弃的线程

release/9.0
abel.chen 6 years ago
parent
commit
c9b7d98df8
  1. 2
      fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java

2
fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java

@ -609,8 +609,10 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
createConnectionThread.setStarted(false); createConnectionThread.setStarted(false);
String destroyName = "Druid-ConnectionPool-Destroy-" + System.identityHashCode(this) + this.getUrl(); String destroyName = "Druid-ConnectionPool-Destroy-" + System.identityHashCode(this) + this.getUrl();
if (destroyConnectionThread != null) { if (destroyConnectionThread != null) {
if (!destroyConnectionThread.isInterrupted()) {
destroyConnectionThread.interrupt(); destroyConnectionThread.interrupt();
} }
}
destroyConnectionThread = new DestroyConnectionThread(destroyName); destroyConnectionThread = new DestroyConnectionThread(destroyName);
destroyConnectionThread.setStarted(false); destroyConnectionThread.setStarted(false);
initedLatch = new CountDownLatch(2); initedLatch = new CountDownLatch(2);

Loading…
Cancel
Save