Author: scheu
Date: Mon Jul 19 15:08:47 2010
New Revision: 965526

URL: http://svn.apache.org/viewvc?rev=965526&view=rev
Log:
AXIS2-4708
Contributor:Rich Scheuerle
Small synchronization change found while testing the AXIS2-4708 fix.

Modified:
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java?rev=965526&r1=965525&r2=965526&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/MarshalServiceRuntimeDescriptionFactory.java
 Mon Jul 19 15:08:47 2010
@@ -42,8 +42,18 @@ public class MarshalServiceRuntimeDescri
                         serviceDesc.getServiceRuntimeDesc(key);
 
         if (desc == null) {
-            desc = MarshalServiceRuntimeDescriptionBuilder.create(serviceDesc);
-            serviceDesc.setServiceRuntimeDesc(desc);
+            // There is only one MSRD per serviceDesc.  Lock
+            // on the serviceDesc while creating the MSRD
+            synchronized(serviceDesc) {
+                desc =
+                    (MarshalServiceRuntimeDescription)
+                            serviceDesc.getServiceRuntimeDesc(key);
+                if (desc == null) {
+
+                    desc = 
MarshalServiceRuntimeDescriptionBuilder.create(serviceDesc);
+                    serviceDesc.setServiceRuntimeDesc(desc);
+                }
+            }
         }
         return desc;
     }


Reply via email to