Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 12796 invoked from network); 6 Nov 2007 12:30:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2007 12:30:23 -0000 Received: (qmail 27850 invoked by uid 500); 6 Nov 2007 12:30:10 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 27800 invoked by uid 500); 6 Nov 2007 12:30:10 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 27789 invoked by uid 99); 6 Nov 2007 12:30:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 04:30:10 -0800 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [192.6.10.60] (HELO tobor.hpl.hp.com) (192.6.10.60) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Nov 2007 12:30:41 +0000 Received: from localhost (localhost [127.0.0.1]) by tobor.hpl.hp.com (Postfix) with ESMTP id 43431B7B42 for ; Tue, 6 Nov 2007 12:29:51 +0000 (GMT) X-Virus-Scanned: amavisd-new at hplb.hpl.hp.com Received: from tobor.hpl.hp.com ([127.0.0.1]) by localhost (tobor.hpl.hp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DIZU3zMm3CKe for ; Tue, 6 Nov 2007 12:29:49 +0000 (GMT) Received: from ha-node-br3.hpl.hp.com (ha-node-br3.hpl.hp.com [16.25.144.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tobor.hpl.hp.com (Postfix) with ESMTPS id 9160CB7B39 for ; Tue, 6 Nov 2007 12:29:49 +0000 (GMT) Received: from [16.25.171.118] (morzine.hpl.hp.com [16.25.171.118]) by ha-node-br3.hpl.hp.com (8.14.1/8.13.4) with ESMTP id lA6CTYWT003286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 6 Nov 2007 12:29:35 GMT Message-ID: <47305E2D.1000006@apache.org> Date: Tue, 06 Nov 2007 12:29:33 +0000 From: Steve Loughran User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: Ant Developers List Subject: Re: terminating running builds better References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HPL-MailScanner-Information: Please contact the ISP for more information X-HPL-MailScanner: Found to be clean X-HPL-MailScanner-From: stevel@apache.org X-Virus-Checked: Checked by ClamAV on apache.org Darin Swanson wrote: > Eclipse is pretty similar to #1. > We have a progress monitor / build listener within which we check to see > if the user has requested to cancel the build. > If the monitor is cancelled we throw a OperationCancelledException which > halts the execution of the build from the Eclipse entry point and reports > the cancelled message to the user. > > Darins > http://www.runnerwhocodes.blogspot.com/ well, I'll do the same thing. Now I know it works. Ant-wise, we could create an interruptable logger that lets you do this formally; the main reason for doing so would be to add tests for it. This is clearly an important use case. > > > > > Jesse Glick > Sent by: news > 11/03/2007 01:19 PM > Please respond to > "Ant Developers List" > > > To > dev@ant.apache.org > cc > > Subject > Re: terminating running builds better > > > > > > > Steve Loughran wrote: >> What do IDEs do to stop ant builds? just kill the thread/process? > > NB behaves as follows: > > 1. It sets a special flag. The next time any BuildListener/BuildLogger > method is called on the IDE's listener, it will throw a BuildException, > which usually stops the build. > > 2. If several seconds have elapsed with no listener method, or if the > build did not stop for any other reason, Thread.stop is called. > > For example, if is the active task, any output > printed will cause #1 to be triggered. Otherwise, ThreadDeath is caught > by the task, which stops the external process and then rethrows. > > Not perfect but seems to work reasonably well in practice. #2 could > probably be improved to first try Thread.interrupt and only use > Thread.stop as a last resort. > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org