diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java index 0a60d69d470..6ba9cb64585 100644 --- a/libjava/java/awt/EventQueue.java +++ b/libjava/java/awt/EventQueue.java @@ -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(); } diff --git a/libjava/java/awt/event/InvocationEvent.java b/libjava/java/awt/event/InvocationEvent.java index 778eb18fab3..6ee6300e7fc 100644 --- a/libjava/java/awt/event/InvocationEvent.java +++ b/libjava/java/awt/event/InvocationEvent.java @@ -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 ()