提交 6e3d8fea 编写于 作者: A ant

8058870: Mac: JFXPanel deadlocks in jnlp mode

Reviewed-by: serb, alexsch
上级 4da9abdf
...@@ -56,6 +56,7 @@ import java.io.ObjectInputStream; ...@@ -56,6 +56,7 @@ import java.io.ObjectInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputValidation; import java.io.ObjectInputValidation;
import java.io.InvalidObjectException; import java.io.InvalidObjectException;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.border.*; import javax.swing.border.*;
import javax.swing.event.*; import javax.swing.event.*;
...@@ -352,7 +353,8 @@ public abstract class JComponent extends Container implements Serializable, ...@@ -352,7 +353,8 @@ public abstract class JComponent extends Container implements Serializable,
private static final int AUTOSCROLLS_SET = 25; private static final int AUTOSCROLLS_SET = 25;
private static final int FOCUS_TRAVERSAL_KEYS_FORWARD_SET = 26; private static final int FOCUS_TRAVERSAL_KEYS_FORWARD_SET = 26;
private static final int FOCUS_TRAVERSAL_KEYS_BACKWARD_SET = 27; private static final int FOCUS_TRAVERSAL_KEYS_BACKWARD_SET = 27;
private static final int REVALIDATE_RUNNABLE_SCHEDULED = 28;
private transient AtomicBoolean revalidateRunnableScheduled = new AtomicBoolean(false);
/** /**
* Temporary rectangles. * Temporary rectangles.
...@@ -4859,16 +4861,11 @@ public abstract class JComponent extends Container implements Serializable, ...@@ -4859,16 +4861,11 @@ public abstract class JComponent extends Container implements Serializable,
// To avoid a flood of Runnables when constructing GUIs off // To avoid a flood of Runnables when constructing GUIs off
// the EDT, a flag is maintained as to whether or not // the EDT, a flag is maintained as to whether or not
// a Runnable has been scheduled. // a Runnable has been scheduled.
synchronized(this) { if (revalidateRunnableScheduled.getAndSet(true)) {
if (getFlag(REVALIDATE_RUNNABLE_SCHEDULED)) { return;
return;
}
setFlag(REVALIDATE_RUNNABLE_SCHEDULED, true);
} }
SunToolkit.executeOnEventHandlerThread(this, () -> { SunToolkit.executeOnEventHandlerThread(this, () -> {
synchronized(JComponent.this) { revalidateRunnableScheduled.set(false);
setFlag(REVALIDATE_RUNNABLE_SCHEDULED, false);
}
revalidate(); revalidate();
}); });
} }
...@@ -5508,6 +5505,7 @@ public abstract class JComponent extends Container implements Serializable, ...@@ -5508,6 +5505,7 @@ public abstract class JComponent extends Container implements Serializable,
ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().registerComponent(this);
} }
setWriteObjCounter(this, (byte)0); setWriteObjCounter(this, (byte)0);
revalidateRunnableScheduled = new AtomicBoolean(false);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册