On Mon, 29 Jan 2024 16:42:15 GMT, Nir Lisker <nlis...@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

Changes requested by kcr (Lead).

tests/system/src/test/java/test/com/sun/javafx/animation/SynchronizationTest.java
 line 87:

> 85:         for (int i = 0; i < 10; i++) {
> 86:             executor.submit(runnable);
> 87:         }

I did a quick prototype of the idea I mentioned in my last comment, and it 
looks like it works:


        Runnable wrappedRunnable = () -> {
            try {
                runnable.run();
            } catch (Throwable e) {
                thread = Thread.currentThread();
                throwable = e;
                failed.set(true);
                waiter.countDown();
            }
        };

        for (int i = 0; i < 10; i++) {
            executor.submit(wrappedRunnable);
        }


This obviates the need for the `registerExceptionHandler` calls in the two 
tests themselves (this one in _this_ method is still needed).

-------------

PR Review: https://git.openjdk.org/jfx/pull/1352#pullrequestreview-1849556169
PR Review Comment: https://git.openjdk.org/jfx/pull/1352#discussion_r1470065959

Reply via email to