aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@gcc.gnu.org>2000-07-15 05:42:47 +0100
committerBryce McKinlay <bryce@gcc.gnu.org>2000-07-15 05:42:47 +0100
commit1b0bd03b7ffba876c9085ee02a9756ac403cae19 (patch)
treee296518597c3a75665dd6887e1af8e9068b20442 /libjava
parentae0e50e87b2a7cf575ff2477ae9db3d9229642ef (diff)
downloadgcc-1b0bd03b7ffba876c9085ee02a9756ac403cae19.zip
gcc-1b0bd03b7ffba876c9085ee02a9756ac403cae19.tar.gz
gcc-1b0bd03b7ffba876c9085ee02a9756ac403cae19.tar.bz2
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
Diffstat (limited to 'libjava')
-rw-r--r--libjava/java/awt/EventQueue.java5
-rw-r--r--libjava/java/awt/event/InvocationEvent.java7
2 files changed, 8 insertions, 4 deletions
diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java
index 0a60d69..6ba9cb6 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 778eb18..6ee6300 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 ()