log LWCToolkit invokeAndWait requests

as part of JBR-3017, to make investigation of similar issues simpler in the future

(cherry-picked from commit a7fd723e43)

(cherry picked from commit d8ca0763a5)
This commit is contained in:
Dmitry Batrak
2021-01-15 12:00:23 +03:00
committed by jbrbot
parent 9dd2e08bfa
commit a0e5cc56b7

View File

@@ -109,6 +109,7 @@ import sun.lwawt.LWWindowPeer.PeerType;
import sun.lwawt.PlatformComponent;
import sun.lwawt.PlatformDropTarget;
import sun.lwawt.PlatformWindow;
import sun.util.logging.PlatformLogger;
@SuppressWarnings("serial") // JDK implementation class
final class NamedCursor extends Cursor {
@@ -175,10 +176,11 @@ public final class LWCToolkit extends LWToolkit {
= !Boolean.parseBoolean(
System.getProperty("javafx.embed.singleThread", "false"));
private static final PlatformLogger log = PlatformLogger.getLogger("sun.lwawt.macosx.LWCToolkit");
public LWCToolkit() {
final String extraButtons = "sun.awt.enableExtraMouseButtons";
areExtraMouseButtonsEnabled =
Boolean.parseBoolean(System.getProperty(extraButtons, "true"));
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty(extraButtons, "true"));
//set system property if not yet assigned
System.setProperty(extraButtons, "" + areExtraMouseButtonsEnabled);
initAppkit(ThreadGroupUtils.getRootThreadGroup(),
@@ -673,6 +675,11 @@ public final class LWCToolkit extends LWToolkit {
if (e != null) throw e;
return object;
}
@Override
public String toString() {
return "CallableWrapper{" + callable + "}";
}
}
private static final AtomicInteger blockingRunLoopCounter = new AtomicInteger(0);
@@ -710,6 +717,10 @@ public final class LWCToolkit extends LWToolkit {
public static void invokeAndWait(Runnable runnable, Component component)
throws InvocationTargetException
{
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("invokeAndWait started: " + runnable);
}
boolean nonBlockingRunLoop;
synchronized (priorityInvocationPending) {
@@ -744,6 +755,10 @@ public final class LWCToolkit extends LWToolkit {
doAWTRunLoop(mediator, nonBlockingRunLoop);
if (!nonBlockingRunLoop) blockingRunLoopCounter.decrementAndGet();
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("invokeAndWait finished: " + runnable);
}
checkException(invocationEvent);
}