Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Daniele Futtorovic Newsgroups: comp.lang.java.gui Subject: Re: Synchronization when collecting data from the EDT? Date: Mon, 06 Jun 2011 14:31:48 +0200 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: <8jPGp.40014$Vp.14760@newsfe14.iad> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 6 Jun 2011 12:31:56 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="LNI6V7Q9y1+rhZqw0hpJtg"; logging-data="5657"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Vz9B0HrJ6mkYuWu3i1ZlC" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:TGfJfmoRF1M69mivTtP20ozy4OM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4580 On 06/06/2011 07:11, Knute Johnson allegedly wrote: > On 06/05/2011 08:47 PM, John B. Matthews wrote: >> Focusing on invokeAndWait() [1], I understood it to be the standard way >> to wait for data to arrive on the EDT. In particular, it promises to >> block until the supplied Runnable's run method has been called on the >> EDT. I don't understand why the Runnable needs a synchronized block. > > The problem with using invokeAndWait() is that it won't block if the > thread is interrupted and it won't start the Runnable() either. Isn't that pretty much how it should be? Why should it gobble that information? If you explicitly want to ignore the interrupted status of your current thread, you can always throw a Thread#interrupted() in the mix. -- DF. Determinism trumps correctness.