8026356: [macosx] Found one Java-level deadlock:"AWT-EventQueue-0" && main
authorserb
Thu, 17 Oct 2013 21:22:05 +0400
changeset 21265 d037a0675f8d
parent 21264 b6c4288ebb92
child 21266 e061c26c0f50
8026356: [macosx] Found one Java-level deadlock:"AWT-EventQueue-0" && main Reviewed-by: anthony, art
jdk/src/share/classes/java/awt/Component.java
--- a/jdk/src/share/classes/java/awt/Component.java	Thu Oct 17 20:54:33 2013 +0400
+++ b/jdk/src/share/classes/java/awt/Component.java	Thu Oct 17 21:22:05 2013 +0400
@@ -276,7 +276,7 @@
      * @see #getFont
      * @see #setFont
      */
-    Font        font;
+    volatile Font font;
 
     /**
      * The font which the peer is currently using.
@@ -1885,10 +1885,8 @@
     public void setFont(Font f) {
         Font oldFont, newFont;
         synchronized(getTreeLock()) {
-            synchronized (this) {
-                oldFont = font;
-                newFont = font = f;
-            }
+            oldFont = font;
+            newFont = font = f;
             ComponentPeer peer = this.peer;
             if (peer != null) {
                 f = getFont();