EventQueue.java (invokeAndWait): Call postEvent() within synchronized block.
authorBryce McKinlay <bryce@gcc.gnu.org>
Sat, 15 Jul 2000 04:42:47 +0000 (05:42 +0100)
committerBryce McKinlay <bryce@gcc.gnu.org>
Sat, 15 Jul 2000 04:42:47 +0000 (05:42 +0100)
* java/awt/EventQueue.java (invokeAndWait): Call postEvent() within
synchronized block.
* java/awt/event/InvocationEvent (dispatch): Synchronize on notifier
before calling notifyAll().

From-SVN: r35042

libjava/java/awt/EventQueue.java
libjava/java/awt/event/InvocationEvent.java

index 0a60d69d4703b346beb8b844aad6d491f2f99c5e..6ba9cb645859bef77f519ba7a7ea1440c0471cfa 100644 (file)
@@ -153,11 +153,10 @@ public class EventQueue
   
     InvocationEvent ie = 
       new InvocationEvent(eq, runnable, current, true);
-    
-    eq.postEvent(ie);
-    
+
     synchronized (current)
       {
+       eq.postEvent(ie);
        current.wait();
       }
 
index 778eb18fab3458b1bdf9d924a0c50f82145c410c..6ee6300e7fcc66f31e9add254288bc70a6ddad84 100644 (file)
@@ -62,7 +62,12 @@ public class InvocationEvent extends AWTEvent implements ActiveEvent
       runnable.run ();
 
     if (notifier != null)
-      notifier.notifyAll ();
+      {
+        synchronized (notifier)
+         {
+           notifier.notifyAll ();
+         }
+      }
   }
 
   public Exception getException ()