Author: sshyrkov
Date: Thu Aug 30 16:46:35 2007
New Revision: 18315

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18315&repname=
=3Djahia
Log:
Refactor synchronized method getInstance()

Modified:
    trunk/core/src/java/org/jahia/registries/ServicesRegistry.java

Modified: trunk/core/src/java/org/jahia/registries/ServicesRegistry.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/registries/ServicesRegistry.java&rev=3D18315&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/registries/ServicesRegistry.java (origina=
l)
+++ trunk/core/src/java/org/jahia/registries/ServicesRegistry.java Thu Aug =
30 16:46:35 2007
@@ -227,9 +227,13 @@
      *
      * @return  the unique instance of this class
      */
-    public static synchronized ServicesRegistry getInstance () {
+    public static ServicesRegistry getInstance () {
         if (theObject =3D=3D null) {
-            theObject =3D new ServicesRegistry();
+            synchronized (ServicesRegistry.class) {
+                if (theObject =3D=3D null) {
+                    theObject =3D new ServicesRegistry();
+                }
+            }
         }
         return theObject;
     }

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to