This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
Patch: EventQueue
- To: java-patches at sourceware dot cygnus dot com
- Subject: Patch: EventQueue
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Sat, 15 Jul 2000 16:47:46 +1200
Bug fixes for EventQueue invocation.
regards
[ bryce ]
2000-07-15 Bryce McKinlay <bryce@albatross.co.nz>
* java/awt/EventQueue.java (invokeAndWait): Call postEvent() within
synchronized block.
* java/awt/event/InvocationEvent (dispatch): Synchronize on notifier
before calling notifyAll().
Index: java/awt/EventQueue.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/EventQueue.java,v
retrieving revision 1.1
diff -u -r1.1 EventQueue.java
--- EventQueue.java 2000/07/12 03:32:06 1.1
+++ EventQueue.java 2000/07/15 03:38:22
@@ -153,11 +153,10 @@
InvocationEvent ie =
new InvocationEvent(eq, runnable, current, true);
-
- eq.postEvent(ie);
-
+
synchronized (current)
{
+ eq.postEvent(ie);
current.wait();
}
Index: java/awt/event/InvocationEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/InvocationEvent.java,v
retrieving revision 1.2
diff -u -r1.2 InvocationEvent.java
--- InvocationEvent.java 2000/07/12 03:32:06 1.2
+++ InvocationEvent.java 2000/07/15 03:38:22
@@ -62,7 +62,12 @@
runnable.run ();
if (notifier != null)
- notifier.notifyAll ();
+ {
+ synchronized (notifier)
+ {
+ notifier.notifyAll ();
+ }
+ }
}
public Exception getException ()