mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed
This commit is contained in:
@@ -36,7 +36,6 @@ import java.util.ServiceLoader;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
@@ -1422,7 +1421,15 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
|
||||
boolean result;
|
||||
final long lastActiveTimeMillis = System.currentTimeMillis();
|
||||
lock.lockInterruptibly();
|
||||
lock.lock();
|
||||
// ====== begin =======
|
||||
// lockInterruptibly的实现有如下问题:
|
||||
// 会导致当前线程被Interrupt时,holder无法正常被回收
|
||||
// 因此改成 lock.lock();
|
||||
// comment by wubiliang(未立)
|
||||
// 原来的代码是
|
||||
// lock.lockInterruptibly();
|
||||
// ====== end =======
|
||||
try {
|
||||
activeCount--;
|
||||
closeCount++;
|
||||
|
||||
Reference in New Issue
Block a user