changeset 8742:3c2d4569a6a3

8026356: [macosx] Found one Java-level deadlock:"AWT-EventQueue-0" && main Reviewed-by: anthony, art
author serb
date Thu, 17 Oct 2013 21:22:05 +0400
parents 70242d821c66
children 5334c651c7ba
files src/share/classes/java/awt/Component.java
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/Component.java	Thu Oct 17 20:54:33 2013 +0400
+++ b/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();