This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix to EventQueue 6/7


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]