On Tue, 2 Jul 2024 03:45:24 GMT, Prasanta Sadhukhan <psadhuk...@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

Reply via email to