sureshanaparti commented on a change in pull request #1257:
URL: https://github.com/apache/cloudstack/pull/1257#discussion_r693672795



##########
File path: vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HostMO.java
##########
@@ -1156,6 +1194,41 @@ public String getNetworkName(String netMorVal) throws 
Exception {
         return networkName;
     }
 
+    public void createPortGroup(HostPortGroupSpec spec) throws Exception {
+        if (spec == null) {
+            return;
+        }
+
+        synchronized (_mor.getValue().intern()) {

Review comment:
       @DaanHoogland `_mor` object val might not be the same / unique while 
attempting this from multiple threads. intern() call on its value ensures same 
val of the String object, and so valid object for synchronisation.
   
   Few similar usages here:
   - 
https://github.com/apache/cloudstack/blob/8a16729fcf10d9e6952fcccc07d8d17952fa6312/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java#L1384
   
   - 
https://github.com/apache/cloudstack/blob/8a16729fcf10d9e6952fcccc07d8d17952fa6312/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HostMO.java#L1167
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to