Try read
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

But I not agree with it's authors... I check it article, and more other
- all of them contains not compiled code or not right code... My guess
for this - it's just flame. More for all - I check with more test
classes on diferent processors computer this code, and it's stay is
stable.

I think that IntelliJ team can fix analiser to support this. But team
must make team-self decision.

Thanks, and it all


-----Original Message-----
From: Maxim Shafirov [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, March 28, 2002 7:59 PM
To: Cedric ROUVRAIS
Subject: Re: [Eap-list] 614: Code Inspection, constant conditions & NPEs


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 
CR> 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

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

Reply via email to