From: Bryce McKinlay Date: Sat, 15 Jul 2000 04:42:47 +0000 (+0100) Subject: EventQueue.java (invokeAndWait): Call postEvent() within synchronized block. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b0bd03b7ffba876c9085ee02a9756ac403cae19;p=gcc.git EventQueue.java (invokeAndWait): Call postEvent() within synchronized block. * java/awt/EventQueue.java (invokeAndWait): Call postEvent() within synchronized block. * java/awt/event/InvocationEvent (dispatch): Synchronize on notifier before calling notifyAll(). From-SVN: r35042 --- 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 ()