RFR: 8334593: Adding, removing and then adding a JFXPanel again leads to NullPointerException [v3]
Andy Goryachev
angorya at openjdk.org
Tue Jul 2 17:16:25 UTC 2024
On Tue, 2 Jul 2024 03:45:24 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> QuantumToolkit.runWithRenderLock
locking a class field may not be sufficient. or rather, cannot be sufficient when multiple threads are accessing the field, as there are no guarantees as to the order of invocations.
Instead, we might need to pass the reference as a variable to the lambda which executes in a different thread. This way no matter what happens to the field, the code that executes in a different context will always have the right object.
And, it might be better not to share the field between the threads and toolkits. Always mutate a particular field in the context of one toolkit - like fieldAWT / fieldFX.
Just a suggestion.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1493#issuecomment-2203876227
More information about the openjfx-dev
mailing list