git-svn-id: http://code.alibabatech.com/svn/druid/trunk@580 b9813039-fb51-4c41-a8b9-e21c2acb5095

This commit is contained in:
wenshao
2011-09-02 16:01:18 +00:00
parent 9d5e57d717
commit 571f595bbf
@@ -501,13 +501,13 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
ConnectionHolder takeLast() throws InterruptedException {
while (activeCount >= maxActive) {
notMaxActive.await();
notMaxActive.await(); // signal by recycle
}
try {
while (poolingCount == 0) {
lowWater.signal(); // send signal to CreateThread create connection
notEmpty.await();
notEmpty.await(); // signal by recycle or creator
}
} catch (InterruptedException ie) {
notEmpty.signal(); // propagate to non-interrupted thread
@@ -518,13 +518,6 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
ConnectionHolder last = connections[poolingCount];
connections[poolingCount] = null;
// if ((minIdle == 0 && poolingCount == 0) || poolingCount <= minIdle - 1) {
// lowWater.signal();
// }
// if (count == 0) {
// lowWater.signal();
// }
return last;
}
@@ -537,7 +530,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
}
if (poolingCount == 0) {
lowWater.signal();
lowWater.signal(); // send signal to CreateThread create connection
estimate = notEmpty.awaitNanos(estimate); // signal by recycle or creator