RFR: 8324658: Allow animation play/start/stop/pause methods to be called on any thread [v14]
Kevin Rushforth
kcr at openjdk.org
Mon Jan 29 18:14:41 UTC 2024
On Mon, 29 Jan 2024 16:42:15 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> Added a utility method to run code on the FX thread if it's not already, and changed the animation methods to use it.
>
> Nir Lisker has updated the pull request incrementally with one additional commit since the last revision:
>
> Update tests
The updated test looks fine (I did leave one question, but it's not important).
I modified the `runOnFxAppThread` method to always run on the calling thread (this reintroducing the original problem), and confirmed that AnimationTimerTest fails (thus catching the bug), but `AnimationTest` still passes, which matches what you are seeing. That might be OK, since the original bug report was on AnimationTimer.
tests/system/src/test/java/test/com/sun/javafx/animation/AnimationTimerTest.java line 48:
> 46: public void handle(long now) {
> 47: // Simulate intensive processing
> 48: Util.sleep(10);
Would this be more likely to catch a problem if this sleep (which is on the FX thread) were reduced to 1 msec? Not sure, but since the timer is started and stopped every 10 msec, it might be worth looking at. On the other hand, it does detect the bug on my Mac, so it might be fine as is.
-------------
Marked as reviewed by kcr (Lead).
PR Review: https://git.openjdk.org/jfx/pull/1352#pullrequestreview-1849413107
PR Review Comment: https://git.openjdk.org/jfx/pull/1352#discussion_r1469993456
More information about the openjfx-dev
mailing list