[OpenJDK 2D-Dev] RFR: 8054991 : sun.font.GlyphList uses broken double-checked locking

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Fri Jul 15 11:04:34 UTC 2016


+1. But one thing, is there any need of

public static GlyphList getInstance(int sz)

which is commented out. I guess we can remove this method.

Regards
Prasanta
On 7/14/2016 8:27 PM, Alexey Ivanov wrote:
> Looks good.
>
>
> Regards,
> Alexey
>
> On 14.07.2016 1:29, Phil Race wrote:
>> This almost got lost. I have updated the fix
>>
>> See http://cr.openjdk.java.net/~prr/8054991/
>>
>> -phil.
>>
>> On 05/26/2016 05:23 AM, Alexey Ivanov wrote:
>>> Hi Phil,
>>>
>>> Since reusableGL is written only once, I'm for marking the field final.
>>>
>>> The proposed patch is attached to JBS bug under the name 'pp'.
>>>
>>> Marking inUse field as volatile seems enough to fix the issue. 
>>> However the suggested patch makes code cleaner.
>>>
>>>
>>> Regards,
>>> Alexey
>>>
>>> On 26.05.2016 1:18, Phil Race wrote:
>>>> bug : https://bugs.openjdk.java.net/browse/JDK-8054991
>>>>
>>>> There is a comment in there about a proposed patch but I can't find 
>>>> it.
>>>> However I think this will be sufficient :-
>>>>
>>>> diff --git a/src/java.desktop/share/classes/sun/font/GlyphList.java 
>>>> b/src/java.desktop/share/classes/sun/font/GlyphList.java
>>>> --- a/src/java.desktop/share/classes/sun/font/GlyphList.java
>>>> +++ b/src/java.desktop/share/classes/sun/font/GlyphList.java
>>>> @@ -152,7 +152,7 @@
>>>>       * created.
>>>>       */
>>>>      private static GlyphList reusableGL = new GlyphList();
>>>> -    private static boolean inUse;
>>>> +    private static volatile boolean inUse;
>>>>
>>>> -phil.
>>>
>>
>




More information about the 2d-dev mailing list