提交 edd8c50e 编写于 作者: S serb

8026356: [macosx] Found one Java-level deadlock:"AWT-EventQueue-0" && main

Reviewed-by: anthony, art
上级 486e356f
...@@ -276,7 +276,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -276,7 +276,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @see #getFont * @see #getFont
* @see #setFont * @see #setFont
*/ */
Font font; volatile Font font;
/** /**
* The font which the peer is currently using. * The font which the peer is currently using.
...@@ -1885,10 +1885,8 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -1885,10 +1885,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
public void setFont(Font f) { public void setFont(Font f) {
Font oldFont, newFont; Font oldFont, newFont;
synchronized(getTreeLock()) { synchronized(getTreeLock()) {
synchronized (this) { oldFont = font;
oldFont = font; newFont = font = f;
newFont = font = f;
}
ComponentPeer peer = this.peer; ComponentPeer peer = this.peer;
if (peer != null) { if (peer != null) {
f = getFont(); f = getFont();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册