Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8123403

Threading issues with ProgressBar / ProgressIndicator after fix for RT-27791

XMLWordPrintable

      The recent change to fix RT-27791 has introduced two threading issues that must be addressed.

      changeset: 4570:3aadad7d5904
      user: mickf
      date: Thu Aug 01 14:43:17 2013 +0100
      summary: RT-27791 :ProgressBar keeps animating when in ScrollPane and scrolled out of view

      First, the threads are not created as daemon threads, which can lead to applications that will not exit. To see this problem, run the Modena app and close the window (using the close button on the window frame). The app will continue to run. See the attached thread stack dump.

      Second, the code is not MT safe (this is from inspection), which could lead to other issues. It calls timeline.play() from the progress indicator thread, which should only be done on the FX application thread.

      Can you comment on why a separate thread is needed in the first place? If you are able to use an animation timeline with a key frame that wakes up every N milliseconds, it seems that both problems would be solved. If this somehow isn't possible then two changes need to be made:

      1) Call Thread.setDaemon(true) before starting the thread

      2) Wrap the call to the Timeline.play() methods in Platform.runLater()

            miflemi Mick Fleming
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: