Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7u10, 8
    • Fix Version/s: tbd_major
    • Component/s: javafx
    • Environment:

      Mac OS X

      Description

      We seem to run into native locks on Mac's AWT implementation, in combination with Swing and embedded JavaFX. Code which is working on Windows, and - as far as tested - on Linux, deadlocks on Mac. In these cases, a thread dump does not show a Java level deadlock, hence the idea about native deadlocks. This is especially the case with awt cursor methods. We have seen this also with drag-and-drop operations (failing on Mac only).

      Here is a reproducible testcase: a jframe with button, button-click shows a jdialog with jfxpanel. The jfxpanel has a button to close the jdialog via invokeAndWait, using setVisible(false) and dispose. This works on Windows. On Mac, the application freezes when clicking the close button in the jdialog/jfxpanel. See comment below for the test code (attachment still don't seem to work). I am also adding comments with stackdumps.

      About the "native deadlocks", here's some reasoning as to why we think that this might be the cause.

      1. FX thread holds cocoa lock when dispatching.
      2. FX thread calls SwingUtilities.invokeAndWait - waiting for EDT.
      3. EDT tries to get cursor position and is blocked by cocoa lock.

      static void perform_dispatch(JNIEnv *env, ... {
        JNF_COCOA_ENTER(env);
       ...

        JNF_COCOA_ENTER(blockEnv);
        ...
          // call the user's runnable
          JNFCallObjectMethod(blockEnv, [wrappedRunnable jObject], jm_run);

       ...
      }

      versus

      JNIEXPORT jobject JNICALL
      Java_sun_lwawt_macosx_CCursorManager_nativeGetCursorPosition(... {
        ...
        JNF_COCOA_ENTER(env);
        ...

        Activity

        Hide
        wlehmann Werner Lehmann added a comment -
        public class CloseInvokeLaterDialogTest extends JFrame
        {
          public static void main(String[] args)
          {
            SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run()
              {
                CloseInvokeLaterDialogTest w = new CloseInvokeLaterDialogTest();
                w.setSize(500, 400);
                w.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                w.setVisible(true);
              }
            });
          }
          
          public CloseInvokeLaterDialogTest()
          {
            JButton b = new JButton("open jdialog with jfxpanel");
            add(b);
            b.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent paramActionEvent)
              {
                FxDialog d = new FxDialog();
                d.setSize(300, 200);
                d.setVisible(true);
              }
            });
          }
          
          static class FxDialog extends JDialog
          {
            public FxDialog()
            {
              final JFXPanel jfxp = new JFXPanel();
              add(jfxp);
              Platform.runLater(new Runnable() {
                @Override
                public void run()
                {
                  Button b = new Button("close with invokeAndWait");
                  b.setOnAction(new EventHandler<javafx.event.ActionEvent>() {
                    @Override
                    public void handle(javafx.event.ActionEvent e)
                    {
                      try
                      {
                        SwingUtilities.invokeAndWait(new Runnable() {
                          @Override
                          public void run()
                          {
                            FxDialog.this.setVisible(false);
                            FxDialog.this.dispose();
                          }
                        });
                      }
                      catch (Exception e1)
                      {
                        e1.printStackTrace();
                      }
                    }
                  });
                  jfxp.setScene(new Scene(b));
                }
              });
            }
          }
        }
        Show
        wlehmann Werner Lehmann added a comment - public class CloseInvokeLaterDialogTest extends JFrame {   public static void main(String[] args)   {     SwingUtilities.invokeLater(new Runnable() {       @Override       public void run()       {         CloseInvokeLaterDialogTest w = new CloseInvokeLaterDialogTest();         w.setSize(500, 400);         w.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);         w.setVisible(true);       }     });   }      public CloseInvokeLaterDialogTest()   {     JButton b = new JButton("open jdialog with jfxpanel");     add(b);     b.addActionListener(new ActionListener() {       @Override       public void actionPerformed(ActionEvent paramActionEvent)       {         FxDialog d = new FxDialog();         d.setSize(300, 200);         d.setVisible(true);       }     });   }      static class FxDialog extends JDialog   {     public FxDialog()     {       final JFXPanel jfxp = new JFXPanel();       add(jfxp);       Platform.runLater(new Runnable() {         @Override         public void run()         {           Button b = new Button("close with invokeAndWait");           b.setOnAction(new EventHandler<javafx.event.ActionEvent>() {             @Override             public void handle(javafx.event.ActionEvent e)             {               try               {                 SwingUtilities.invokeAndWait(new Runnable() {                   @Override                   public void run()                   {                     FxDialog.this.setVisible(false);                     FxDialog.this.dispose();                   }                 });               }               catch (Exception e1)               {                 e1.printStackTrace();               }             }           });           jfxp.setScene(new Scene(b));         }       });     }   } }
        Hide
        wlehmann Werner Lehmann added a comment -
        Stack dump.

        "AWT-EventQueue-0" prio=5 tid=0x00007febf1856800 nid=0x8d0b runnable [0x0000000127615000]
           java.lang.Thread.State: RUNNABLE
        at sun.lwawt.macosx.CCursorManager.nativeGetCursorPosition(Native Method)
        at sun.lwawt.macosx.CCursorManager.getCursorPosition(CCursorManager.java:63)
        at sun.lwawt.LWCursorManager.updateCursorImpl(LWCursorManager.java:79)
        at sun.lwawt.LWCursorManager.updateCursor(LWCursorManager.java:56)
        at sun.lwawt.LWComponentPeer.updateCursorImmediately(LWComponentPeer.java:885)
        at java.awt.Component.updateCursorImmediately(Component.java:3123)
        at java.awt.Component.hide(Component.java:1696)
        - locked <0x000000010dee3ca0> (a java.awt.Component$AWTTreeLock)
        at java.awt.Window.hide(Window.java:1116)
        at java.awt.Dialog.hide(Dialog.java:1174)
        at java.awt.Component.show(Component.java:1653)
        at java.awt.Component.setVisible(Component.java:1603)
        at java.awt.Window.setVisible(Window.java:1014)
        at java.awt.Dialog.setVisible(Dialog.java:1003)
        at mint.javafx.CloseInvokeLaterDialogTest$FxDialog$1$1$1.run(CloseInvokeLaterDialogTest.java:70)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721)
        at java.awt.EventQueue.access$200(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:682)
        at java.awt.EventQueue$3.run(EventQueue.java:680)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:691)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

        "JavaFX Application Thread" daemon prio=5 tid=0x00007febf08c2000 nid=0x2807 in Object.wait() [0x00007fff5ddf5000]
           java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000001062070a8> (a java.awt.EventQueue$1AWTInvocationLock)
        at java.lang.Object.wait(Object.java:503)
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1252)
        - locked <0x00000001062070a8> (a java.awt.EventQueue$1AWTInvocationLock)
        at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1349)
        at mint.javafx.CloseInvokeLaterDialogTest$FxDialog$1$1.handle(CloseInvokeLaterDialogTest.java:66)
        at mint.javafx.CloseInvokeLaterDialogTest$FxDialog$1$1.handle(CloseInvokeLaterDialogTest.java:1)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
        at javafx.event.Event.fireEvent(Event.java:171)
        at javafx.scene.Node.fireEvent(Node.java:6863)
        at javafx.scene.control.Button.fire(Button.java:179)
        at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
        at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
        at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
        at javafx.event.Event.fireEvent(Event.java:171)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3324)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3164)
        at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3119)
        at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1559)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2261)
        at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:184)
        at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
        Show
        wlehmann Werner Lehmann added a comment - Stack dump. "AWT-EventQueue-0" prio=5 tid=0x00007febf1856800 nid=0x8d0b runnable [0x0000000127615000]    java.lang.Thread.State: RUNNABLE at sun.lwawt.macosx.CCursorManager.nativeGetCursorPosition(Native Method) at sun.lwawt.macosx.CCursorManager.getCursorPosition(CCursorManager.java:63) at sun.lwawt.LWCursorManager.updateCursorImpl(LWCursorManager.java:79) at sun.lwawt.LWCursorManager.updateCursor(LWCursorManager.java:56) at sun.lwawt.LWComponentPeer.updateCursorImmediately(LWComponentPeer.java:885) at java.awt.Component.updateCursorImmediately(Component.java:3123) at java.awt.Component.hide(Component.java:1696) - locked <0x000000010dee3ca0> (a java.awt.Component$AWTTreeLock) at java.awt.Window.hide(Window.java:1116) at java.awt.Dialog.hide(Dialog.java:1174) at java.awt.Component.show(Component.java:1653) at java.awt.Component.setVisible(Component.java:1603) at java.awt.Window.setVisible(Window.java:1014) at java.awt.Dialog.setVisible(Dialog.java:1003) at mint.javafx.CloseInvokeLaterDialogTest$FxDialog$1$1$1.run(CloseInvokeLaterDialogTest.java:70) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:721) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:682) at java.awt.EventQueue$3.run(EventQueue.java:680) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:691) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) "JavaFX Application Thread" daemon prio=5 tid=0x00007febf08c2000 nid=0x2807 in Object.wait() [0x00007fff5ddf5000]    java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000001062070a8> (a java.awt.EventQueue$1AWTInvocationLock) at java.lang.Object.wait(Object.java:503) at java.awt.EventQueue.invokeAndWait(EventQueue.java:1252) - locked <0x00000001062070a8> (a java.awt.EventQueue$1AWTInvocationLock) at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1349) at mint.javafx.CloseInvokeLaterDialogTest$FxDialog$1$1.handle(CloseInvokeLaterDialogTest.java:66) at mint.javafx.CloseInvokeLaterDialogTest$FxDialog$1$1.handle(CloseInvokeLaterDialogTest.java:1) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28) at javafx.event.Event.fireEvent(Event.java:171) at javafx.scene.Node.fireEvent(Node.java:6863) at javafx.scene.control.Button.fire(Button.java:179) at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193) at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336) at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33) at javafx.event.Event.fireEvent(Event.java:171) at javafx.scene.Scene$MouseHandler.process(Scene.java:3324) at javafx.scene.Scene$MouseHandler.process(Scene.java:3164) at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3119) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1559) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2261) at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:184) at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
        Hide
        wlehmann Werner Lehmann added a comment -
        One more thing. AWT is supposed to be thread-safe, so it should be legal to call dispose from any thread. As it turns out, this will trigger an implicit invokeAndWait inside AWT, leading to the same problem:

        "JavaFX Application Thread" daemon prio=5 tid=0x00007fa3dc0a5800 nid=0x707 in Object.wait() [0x00007fff5bdd0000]
           java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:503)
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1263)
        - locked <0x000000012c8d46a0> (a java.awt.EventQueue$1AWTInvocationLock)
        at java.awt.Window.doDispose(Window.java:1209)
        at java.awt.Dialog.doDispose(Dialog.java:1196)
        at java.awt.Window.dispose(Window.java:1147)
        Show
        wlehmann Werner Lehmann added a comment - One more thing. AWT is supposed to be thread-safe, so it should be legal to call dispose from any thread. As it turns out, this will trigger an implicit invokeAndWait inside AWT, leading to the same problem: "JavaFX Application Thread" daemon prio=5 tid=0x00007fa3dc0a5800 nid=0x707 in Object.wait() [0x00007fff5bdd0000]    java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:503) at java.awt.EventQueue.invokeAndWait(EventQueue.java:1263) - locked <0x000000012c8d46a0> (a java.awt.EventQueue$1AWTInvocationLock) at java.awt.Window.doDispose(Window.java:1209) at java.awt.Dialog.doDispose(Dialog.java:1196) at java.awt.Window.dispose(Window.java:1147)
        Hide
        art Artem Ananiev added a comment -
        There are many fixes about native deadlocks in AWT on Mac in JDK8. Some of them are backported to 7u40. 7u40 early access builds are available at https://jdk7.java.net/download.html, could you try your application and check if the deadlock is still there, please?
        Show
        art Artem Ananiev added a comment - There are many fixes about native deadlocks in AWT on Mac in JDK8. Some of them are backported to 7u40. 7u40 early access builds are available at https://jdk7.java.net/download.html, could you try your application and check if the deadlock is still there, please?
        Hide
        art Artem Ananiev added a comment -
        It's still reproducible with the latest JDK/FX 8 builds. The problem is not related to cursors, at least, not only to cursors. AWT dispatches all the platform calls, including Window.dispose(), to the AppKit thread, which is currently blocked in the FX event handler.

        Unfortunately, this is not what we can easily fix in FX. First, we can expose public API to created nested event loops in FX. It would still be somewhat verbose to use. Second, we can suggest application developers to use another pattern than is listed in the test:

        b.setOnAction((javafx.event.ActionEvent) -> {
            SwingUtilities.invokeLater(() -> {
                FxDialog.this.setVisible(false);
                FxDialog.this.dispose();
                Platform.runLater(() -> {
                    // All the calls from event handler after invokeAndWait()
                });
            });
        });

        Of course, if there is no need to execute something synchronously on the AWT/Swing dispatch thread, simply changing invokeAndWait() to invokeLater() will eliminate the deadlock.
        Show
        art Artem Ananiev added a comment - It's still reproducible with the latest JDK/FX 8 builds. The problem is not related to cursors, at least, not only to cursors. AWT dispatches all the platform calls, including Window.dispose(), to the AppKit thread, which is currently blocked in the FX event handler. Unfortunately, this is not what we can easily fix in FX. First, we can expose public API to created nested event loops in FX. It would still be somewhat verbose to use. Second, we can suggest application developers to use another pattern than is listed in the test: b.setOnAction((javafx.event.ActionEvent) -> {     SwingUtilities.invokeLater(() -> {         FxDialog.this.setVisible(false);         FxDialog.this.dispose();         Platform.runLater(() -> {             // All the calls from event handler after invokeAndWait()         });     }); }); Of course, if there is no need to execute something synchronously on the AWT/Swing dispatch thread, simply changing invokeAndWait() to invokeLater() will eliminate the deadlock.
        Hide
        wlehmann Werner Lehmann added a comment -
        The general problem seems to be that event dispatching in JavaFX is done from native code, where the COCOA native lock is already acquired: FX application stacktrace does not start with any xxxThread.run() method which usually means it is called from some native code and cannot be included into the stacktrace. Maybe it is possible to post the native event into the FX application thread for later dispatching (like AWT-EventQueue-XX does), effectively releasing any native locks on the COCOA main thread?

        Question is of course why this deadlock does not occur under Windows. The answer might be in that COCOA framework basically does not support multithreading - and AWT implementation must follow this rule under OSX, every time acquiring native lock -, whereas Windows API generally allows this. Possibly this needs to be fixed in AWT implementation, unless there is a known limitation for native event dispatching.
        Show
        wlehmann Werner Lehmann added a comment - The general problem seems to be that event dispatching in JavaFX is done from native code, where the COCOA native lock is already acquired: FX application stacktrace does not start with any xxxThread.run() method which usually means it is called from some native code and cannot be included into the stacktrace. Maybe it is possible to post the native event into the FX application thread for later dispatching (like AWT-EventQueue-XX does), effectively releasing any native locks on the COCOA main thread? Question is of course why this deadlock does not occur under Windows. The answer might be in that COCOA framework basically does not support multithreading - and AWT implementation must follow this rule under OSX, every time acquiring native lock -, whereas Windows API generally allows this. Possibly this needs to be fixed in AWT implementation, unless there is a known limitation for native event dispatching.
        Hide
        art Artem Ananiev added a comment -
        On all the platforms, JavaFX event dispatching is done from native code. The difference between Mac OS X and Windows is where the event dispatch thread is created. On Mac, it's the AppKit thread created by OS runtime. On Windows, it's created from JavaFX code.

        The deadlock doesn't happen on Windows, because on that platform AWT toolkit thread and JavaFX event thread are different. Even if the FX thread is blocked in the event handler, AWT is still able to synchronously call from EDT to the toolkit thread and dispose the window. On Mac, however, it's not possible to have multiple event dispatch threads, so AWT toolkit thread is the same as FX event thread (and as the AppKit thread). Locks are irrelevant here.
        Show
        art Artem Ananiev added a comment - On all the platforms, JavaFX event dispatching is done from native code. The difference between Mac OS X and Windows is where the event dispatch thread is created. On Mac, it's the AppKit thread created by OS runtime. On Windows, it's created from JavaFX code. The deadlock doesn't happen on Windows, because on that platform AWT toolkit thread and JavaFX event thread are different. Even if the FX thread is blocked in the event handler, AWT is still able to synchronously call from EDT to the toolkit thread and dispose the window. On Mac, however, it's not possible to have multiple event dispatch threads, so AWT toolkit thread is the same as FX event thread (and as the AppKit thread). Locks are irrelevant here.
        Hide
        mkhramov Maksim Khramov (Inactive) added a comment -
        RULE "Swing_SwingNode/Automated/SwingNodeJPopupMenuTest" Timeout none
        Show
        mkhramov Maksim Khramov (Inactive) added a comment - RULE "Swing_SwingNode/Automated/SwingNodeJPopupMenuTest" Timeout none

          People

          • Assignee:
            Unassigned
            Reporter:
            wlehmann Werner Lehmann
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Imported: