From 1b0bd03b7ffba876c9085ee02a9756ac403cae19 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Sat, 15 Jul 2000 05:42:47 +0100 Subject: [PATCH] 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 --- libjava/java/awt/EventQueue.java | 5 ++--- libjava/java/awt/event/InvocationEvent.java | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) 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 ()