Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11ED7DB46 for ; Fri, 24 May 2013 21:11:38 +0000 (UTC) Received: (qmail 36111 invoked by uid 500); 24 May 2013 21:11:37 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 36056 invoked by uid 500); 24 May 2013 21:11:37 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 36047 invoked by uid 99); 24 May 2013 21:11:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 21:11:37 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [76.96.62.96] (HELO qmta09.westchester.pa.mail.comcast.net) (76.96.62.96) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 21:11:28 +0000 Received: from omta10.westchester.pa.mail.comcast.net ([76.96.62.28]) by qmta09.westchester.pa.mail.comcast.net with comcast id fnv81l0010cZkys59xAnNz; Fri, 24 May 2013 21:10:47 +0000 Received: from Christophers-MacBook-Pro.local ([69.143.106.98]) by omta10.westchester.pa.mail.comcast.net with comcast id fxAk1l00E27QCxh3WxAmxK; Fri, 24 May 2013 21:10:47 +0000 Message-ID: <519FD755.8020003@christopherschultz.net> Date: Fri, 24 May 2013 17:10:45 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: [PATCH] jdbc-pool | FairBlockingQueue References: <6C4327D5-AEF7-44E4-B81F-79A688798228@me.com> In-Reply-To: <6C4327D5-AEF7-44E4-B81F-79A688798228@me.com> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2VUIJHHORTDRPNWSOJQKM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1369429847; bh=2RaV4w4Uy9bKlSbKybohpPU82nJmrIE4lH5A9Ont50I=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=fDa3Dmi90B7QcaXj/wp1pxjIye99h2ldL7oKZX7h7Cf7B6KBaP+hS8Y/D+7i5FC1w uBJ5VEQjoibEn6THxSRc5M0OTztRPEleDvX8STZ8pa7dk+R8wX84cJ4N3eji9f7AYq b7N7cCgOq0FlVYTc7/l9n73Y5QPIIvqooEMrkrE/r7xbsANDWghzzphkkwxL7muCIL flreyeUH1Mcjug4m8E5Hi5Bcd+UlAIrEpvVwlUoJ67Utp61PwVJ9Blr0+7rln0oFY7 XD7RlxiZH9SA4lJ+3lrHro0b4DCPafZQncjilL8A3rqAqDlFvlJ3BQbiY5W7e9zipW GgUSeFnmpTNGA== X-Virus-Checked: Checked by ClamAV on apache.org ------enig2VUIJHHORTDRPNWSOJQKM Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Bj=C3=B6rn, On 5/24/13 4:08 PM, Bj=C3=B6rn Raupach wrote: > out of pure curiosity I was browsing the source of jdbc-pool and > ended up looking through FairBlockingQueue. FairBlockingQueue > utilises a global ReentrantLock for mutual exclusion. Common practice > is to always follow a call to lock with a try-finally block. The > methods poll(long, TimeUnit), pollAsync() don't use that practice. I > was wondering why. Attached is modified version of FairBlockingQueue. > I know FairBlockingQueue is a sensitive part of jdbc-pool and I am > certainly not trying to smart ass. Its just interest and probably > only a minor issue. Your attachment has been stripped from the list. It's best to attach patches to Bugzilla entries, but I'd wait and see if anyone objects to the idea before filing the bug. If you can write a test that demonstrates a bug, that would be even better... "bug fixes" that come from pure code-reviews tend to be viewed skeptically around here, though this one seems to theoretically lead to deadlock. If it can theoretically lead to deadlock, can you force a situation where it *actually* leads to deadlock (or some other unfortunate conditio= n)? -chris ------enig2VUIJHHORTDRPNWSOJQKM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJRn9dVAAoJEBzwKT+lPKRYZVMQAKVpOazJslFNPBLXJln8PCsc kS5ldNIOl6oJ0IvQm2cXhqlEt7MRrPv0qbeO27MQXyOPir31O0A3pRwJiQJYo1ve AIEmrJaEgD9pzhCXntQW7qvQ2LRUP4S5NjPqIWJrMamrzcFswLyyN5A21Tiqtpsl y6tNlLi3S1PIqcGPvNX80GgqVD7JvhpeWK3WDGIprRdtL5yyiCpjJZ/CwTmQqOOs yfpiyFxBrg9hf8yN+iPAa7C1egRpj5Rr/iHMX84HPq86bmmUYEFhKAn3GqWCib/v bMLryWOS5k5JEszqg1BBWhI24V2kxjS00PjEW3DzXgwZB1j1imZ8dWufm1DtPNWa REkw6yqVJCqTWqswY4ouclF0xi70s1UABt5iwsDRcyaSJwHhTod6xpPX0HFTYanZ etOAwFMabgvpiEZESEBRU/sqsoiIG7wzppjk1V5wnn49B+ecjh121H1H0ZDTF9oM bEMjTtsTG1FllEu7feRpcNC4kdKMho8Eu5pgWyyuskXU2qZYBE5+NwMkgrH96lbO 3o+vU7v3IAZkbYANH0JCOX5Nw9nCFephzr6I4i96W1/VIchvvVFI4apKkTNkPqGy haxpJHnFQpcNEbkv9vKFfBbNIVMjhx1m3Eubq568RUQR+fpOavTH3QT67+qeRO4x 33jks+e/KusBaj8d2y55 =Y8Wl -----END PGP SIGNATURE----- ------enig2VUIJHHORTDRPNWSOJQKM--