[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: 8302849: SurfaceManager might expose partially constructed object
From:       Andrey Turbanov <aturbanov () openjdk ! org>
Date:       2023-02-25 17:02:12
Message-ID: c867TXVYnaBFLSLxI8RljuRfaTa02M69j0Ue_n1pi7M=.75eacbc7-9ce2-4bd7-a9be-9103d32f2c30 () github ! com
[Download RAW message or body]

On Mon, 20 Feb 2023 10:25:34 GMT, Per Minborg <pminborg@openjdk.org> wrote:

> This PR proposes to add `volatile` to a variable declaration in order to prevent \
> partially initialized objects to be observed by threads. 
> `SurfaceManager` is using a lazily initialized cacheMap that is initialized using a \
> double-checked locking mechanism. Generally, objects initialized using such \
> constructs need to be declared volatile.  
> See https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java

Copyright year update seems forgotten.

-------------

PR: https://git.openjdk.org/jdk/pull/12654


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic