commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: InvocationEvent.dispatch() fixlet


From: Mark Wielaard
Subject: FYI: InvocationEvent.dispatch() fixlet
Date: Thu, 01 Jul 2004 20:24:10 +0200

Hi,

We forgot to take the lock on the notifier object before calling
notifyAll() making it always throw an IllegalMonitorStateException.

2004-07-01  Mark Wielaard  <address@hidden>

       * java/awt/event/InvocationEvent.java (dispatch): Synchronize
       on notifier object before calling notifyAll().

Found by playing with HyperTree examples that Roman posted.
http://ontographics.com/classpath/screenshots.html
With this patch you can click on the nodes and they will automagically
move to the center. It is really cool and you need to see/feel it for
yourself.

Committed.

Cheers,

Mark

--- java/awt/event/InvocationEvent.java 30 Mar 2002 12:02:30 -0000     
1.5
+++ java/awt/event/InvocationEvent.java 1 Jul 2004 18:20:47 -0000
@@ -189,8 +189,13 @@
         }
     else
       runnable.run();
-    if (notifier != null)
-      notifier.notifyAll();
+
+    Object o = notifier;
+    if (o != null)
+      synchronized(o)
+       {
+         o.notifyAll();
+       }

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]