<AWT Dev> [9] Review Request: 8138764 In some cases the usage of TreeLock can be replaced by other synchronization

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Fri Oct 16 10:56:52 UTC 2015

On 10/6/2015 5:09 PM, Sergey Bylokhov wrote:
> Hello.
> 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[1], 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?

> These changes are subset of my fix for JDK-6765536, which is safe to 
> backport to jdk8.
> [1] 
> http://hg.openjdk.java.net/jdk6/jdk6/jdk/diff/e7ecde4010e9/src/share/classes/java/awt/Component.java
> Bug: https://bugs.openjdk.java.net/browse/JDK-8138764
> Webrev can be found at: 
> http://cr.openjdk.java.net/~serb/8138764/webrev.00

More information about the awt-dev mailing list