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

8058870: Mac: JFXPanel deadlocks in jnlp mode

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