mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@574 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -530,23 +530,21 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
|
||||
ConnectionHolder pollLast(long timeout, TimeUnit unit) throws InterruptedException {
|
||||
long nanos = unit.toNanos(timeout);
|
||||
long estimate = unit.toNanos(timeout);
|
||||
|
||||
for (;;) {
|
||||
if (activeCount >= maxActive) {
|
||||
nanos = notMaxActive.awaitNanos(nanos);
|
||||
estimate = notMaxActive.awaitNanos(estimate);
|
||||
}
|
||||
|
||||
if (poolingCount == 0) {
|
||||
lowWater.signal();
|
||||
|
||||
long estimate = nanos;
|
||||
for (;;) {
|
||||
estimate = notEmpty.awaitNanos(estimate);
|
||||
|
||||
if (poolingCount == 0) {
|
||||
if (estimate > 0) {
|
||||
nanos = estimate;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -562,13 +560,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
connections[lastIndex] = null;
|
||||
poolingCount--;
|
||||
|
||||
// if (lastIndex == minIdle - 1) {
|
||||
// lowWater.signal();
|
||||
// }
|
||||
// if ((minIdle == 0 && poolingCount == 0) || poolingCount <= minIdle - 1) {
|
||||
// lowWater.signal();
|
||||
// }
|
||||
|
||||
return last;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user