synchronized on class looks a little bit unsafe to me.  As singleton is
a static variable, creating the instance during initialization looks safer.

-   private static Config singleton = null;
+   private static Config singleton = new Config();

Xuelei

On 5/25/2015 10:16 PM, Weijun Wang wrote:
> Hi All
> 
> Please review a code change at
> 
>   http://cr.openjdk.java.net/~weijun/8080911/webrev.00/
> 
> I've limit the synchronized block to Config creation only and therefore
> won't deadlock with EType's class initialization.
> 
> Noreg-hard. The EType call is at class initialization and only run once
> in a VM session, which is extremely difficult to catch.
> 
> Thanks
> Max

Reply via email to