Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 76052 invoked from network); 24 Oct 2005 18:41:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Oct 2005 18:41:38 -0000 Received: (qmail 9695 invoked by uid 500); 24 Oct 2005 18:41:34 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 9668 invoked by uid 500); 24 Oct 2005 18:41:34 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 9656 invoked by uid 99); 24 Oct 2005 18:41:33 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2005 11:41:33 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [12.154.210.214] (HELO rectangular.com) (12.154.210.214) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2005 11:41:31 -0700 Received: from [67.189.26.9] (helo=[10.0.1.2]) by rectangular.com with esmtpa (Exim 4.44) id 1EU7RW-000Ois-VN for java-dev@lucene.apache.org; Mon, 24 Oct 2005 11:53:11 -0700 Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: <435D07E7.3050807@apache.org> References: <435D07E7.3050807@apache.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marvin Humphrey Subject: Re: Lock class question Date: Mon, 24 Oct 2005 11:41:10 -0700 To: java-dev@lucene.apache.org X-Mailer: Apple Mail (2.734) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Oct 24, 2005, at 9:12 AM, Doug Cutting wrote: > Marvin Humphrey wrote: > >> What are the advantages of the With class? Why not just obtain >> the lock, run a block, and release the lock? > > The release should be in a 'finally' block. 'With' enforces that. Ah. No 'finally' blocks in Perl, but I can mimic the flow using eval [BLOCK], and achieve the "enforcement" aspect. Thanks, Marvin Humphrey Rectangular Research http://www.rectangular.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org