On 9/13/2017 3:08 PM, Sergey Bylokhov wrote:
On 9/13/17 13:19, Semyon Sadetsky wrote:
It is not obviously since it should be thread safe, and it is already used minimum from 3 threads main/edt/toolkit.
Can you provide examples where dispose() and setVisible() is called simultaneously from different threads in JDK code? Making Linux peers thread-safe would be too big change that may introduce deadlocks. We don't need to make situation even worse than it is now.

It should be already thread safe, there were even your fixes when the synchronization in the peers was reworked:
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/500fb73e193f
This fix improves synchronization for window dimensions stability and that was done after the frame extents algorithm was rewritten. The latter caused a lot of regressions because there are many scenarios which are not covered by tests. Anyway this didn't far solve all mulithreading issues in linux peers. It would require total redesign. Adding volatile modifier to all fields will not make those classes totally safe in multithreaded use.

The problem in the fix is that the new checks do not try to be thread safe.
So, what do you propose? Add a volatile field "disposing" and do noop if it is true?



--Semyon


--Semyon


On 09/13/2017 11:55 AM, Sergey Bylokhov wrote:
On 9/13/17 11:49, Semyon Sadetsky wrote:
The tests passes after the fix for me. Which situations do you mean? Can you provide examples?

For example in XFramePeer.setVisible() it is possible that the peer became disposed after the new check.


--Semyon


On 09/11/2017 03:20 PM, Sergey Bylokhov wrote:
Hi, Semyon.
Did you check why the bug is not reproduced on jdk8?
I guess that it is still possible to get a situations below because of absent synchronization on all paths of usage "window",isDispose() and dispose() method:
 - check isDispose().
 - dispose the peer
 - use the long value which was disposed step above


On 9/8/17 20:00, Semyon Sadetsky wrote:
Hello,

Please review fix for JDK10:

bug: https://bugs.openjdk.java.net/browse/JDK-8186495

webrev: http://cr.openjdk.java.net/~ssadetsky/8186495/webrev.00/

After toolkit window is destroyed methods invocations on the window component may cause exceptions because of wrong native xwindow ID. The fix introduces checks in the X* peers to ensure that window ID is actual otherwise do nothing.

--Semyon













Reply via email to