This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: EventQueue


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 ()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]