This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Fix to EventQueue 6/7
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: Fernando Nasser <fnasser at redhat dot com>
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: Mon, 19 Jan 2004 12:58:40 -0500
- Subject: Re: [PATCH] Fix to EventQueue 6/7
- References: <400C068A.4050602@redhat.com>
On Mon, 2004-01-19 at 11:32, Fernando Nasser wrote:
> This fixes invokeAndWait if called after a modal dialog is up.
>
>
> 2004-01-19 Fernando Nasser <fnasser@redhat.com>
>
> * java/awt/EventQueue.java (invokeAndWait): Use list-aware
> isDispatchThread method to replace wrong test condition.
OK, thanks.
Tom
________________________________________________________________________
> Index: java/awt/EventQueue.java
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/java/awt/EventQueue.java,v
> retrieving revision 1.15
> diff -u -p -r1.15 EventQueue.java
> --- java/awt/EventQueue.java 19 Jan 2004 14:51:54 -0000 1.15
> +++ java/awt/EventQueue.java 19 Jan 2004 16:28:13 -0000
> @@ -231,10 +231,11 @@ public class EventQueue
> public static void invokeAndWait(Runnable runnable)
> throws InterruptedException, InvocationTargetException
> {
> + if (isDispatchThread ())
> + throw new Error("Can't call invokeAndWait from event dispatch thread");
> +
> EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
> Thread current = Thread.currentThread();
> - if (current == eq.dispatchThread)
> - throw new Error("Can't call invokeAndWait from event dispatch thread");
>
> InvocationEvent ie =
> new InvocationEvent(eq, runnable, current, true);