8231372: JFXPanel fails to render if setScene called on Swing thread #362
While evaluating a bug that I filed, JDK-8235843, I discovered that that bug was a duplicate of this one. The original proposed fix is correct, although I modified it slightly to add a try / finally so that the secondary event loop will be terminated even if the setScene throws an exception. I also added a unit test. Since the bulk of the fix is from PR #16, I will add the contributor of that PR.
NOTE to reviewers: I pushed two commits to my branch. The first is exactly the commit created for PR #16 and the second is the unit test along with the fix to the code to add try / finally. As always, they will be squashed into a single commit by Skara.
/summary Correctly terminate secondary event loop in JFXPanel::setScene
/contributor add Michal Růžička email@example.com
Secondary event loop introduced as a means of synchronization with the JavaFX Application thread in  never terminates as the SecondaryLoop.exit() call is not reached because the thread is blocked in the SecondaryLoop.enter() call. This patch fixes the problem by submitting the UI work (including the call to the SecondaryLoop.exit() method) before entering the secondary loop.  7cf2dfa
@kevinrushforth This change now passes all automated pre-integration checks.
After integration, the commit message for the final commit will be:
At the time when this comment was updated there had been 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
@kevinrushforth Since your change was applied there have been 3 commits pushed to the
Your commit was automatically rebased without conflicts.
Pushed as commit 794ffc0.