From 1f41937115fcd3c362ea5bcd93ca89f7b09b8a4d Mon Sep 17 00:00:00 2001 From: bryce Date: Sat, 15 Jul 2000 04:42:47 +0000 Subject: * java/awt/EventQueue.java (invokeAndWait): Call postEvent() within synchronized block. * java/awt/event/InvocationEvent (dispatch): Synchronize on notifier before calling notifyAll(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35042 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/awt/EventQueue.java | 5 ++--- libjava/java/awt/event/InvocationEvent.java | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'libjava/java') 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 () -- cgit v1.2.3