Hello Cedric,

This topic had already been discussed in eap several days ago. As the
matter of fact double synchronization does not makes what it intended
to in the current implementation of JVM.

-- 
Best regards,
Maxim Shafirov
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"

CR> Hi,

CR> The following code comes out as always false (second 'if (null)'):

CR>   public static ServiceManager getInstance() throws RaccoonException {
CR>     if (mServiceManager == null) {
CR>       synchronized(ServiceManager.class) {
CR>         /** We check if the singleton is still null */
CR>         if (mServiceManager == null) { <= Code inspection yells here
CR>           mServiceManager = new ServiceManager();
CR>           mServiceManager.setPropertyFileName("service");
CR>           /** Initialise the ServiceLoader */
CR>           mServiceManager.start();
CR>         }
CR>       }
CR>     }
CR>     return mServiceManager;
CR>   }

CR> Maybe a special case could be handled for code surrounded by synchronized?

CR> This is a very very low priority too me, but a nice to have :o)

CR> a++ Cedric

CR> _______________________________________________
CR> Eap-list mailing list
CR> [EMAIL PROTECTED]
CR> http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to