<AWT Dev>  Review Request: 8138764 In some cases the usage of TreeLock can be replaced by other synchronization
Sergey.Bylokhov at oracle.com
Sun Oct 18 21:37:51 UTC 2015
On 16.10.15 13:56, Alexander Scherbatiy wrote:
> On 10/6/2015 5:09 PM, Sergey Bylokhov wrote:
>> Please review the fix for jdk9, I plan to backport it to jdk8.
>> In this fix some of synchronizations on TreeLock were removed.
>> - Component.java(CachedPainter.java) : long time ago this
>> synchronization was necessary, because the getGC method iterated over
>> hierarchy of components, but now it simple getter.
>> - Window.java : locationByPlatform and opacity are changed to volatile
>> and an additional synchronization is removed.
> CachedPainter.java: Can the component hierarchy be changed from
> another thread during the paint0(component, ...) call?
Yes it can be changed in any moment, in this case it will work in the
same way as JComponent.paintComponent() or other places where we draw
something to the component or backbuffer.
This synchronization was added as a part of JDK-6190373. It has a
deadlock description which was solved. In those moment it cannot be
solved in different way because TreeLock was needed in Component.getGC().
I will provide the webrev and review of those bug in another email.
>> These changes are subset of my fix for JDK-6765536, which is safe to
>> backport to jdk8.
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8138764
>> Webrev can be found at:
Best regards, Sergey.
More information about the awt-dev