timeout of 0 means we return right away
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 21 Nov 2008 05:22:14 +0000 (05:22 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 21 Nov 2008 05:22:14 +0000 (05:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@719481 13f79535-47bb-0310-9956-ffa450edef68

modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/FairBlockingQueue.java

index c25e207..4eea64b 100644 (file)
@@ -76,7 +76,7 @@ public class FairBlockingQueue<E> implements BlockingQueue<E> {
         lock.lock();
         try {
             result = items.poll();
-            if (result==null) {
+            if (result==null && timeout>0) {
                 ExchangeCountDownLatch<E> c = new ExchangeCountDownLatch<E>(1);
                 waiters.addLast(c);
                 lock.unlock();