[Swift-commit] cog r3748

swift at ci.uchicago.edu swift at ci.uchicago.edu
Thu Jul 25 11:40:02 CDT 2013


------------------------------------------------------------------------
r3748 | hategan | 2013-07-25 11:39:15 -0500 (Thu, 25 Jul 2013) | 1 line

synchronize on parent when replacing stuff in it since it may be in bind(), not fully initialized
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/FlowElementWrapper.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/FlowElementWrapper.java	(revision 3747)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/FlowElementWrapper.java	(working copy)
@@ -290,11 +290,13 @@
 	private void replaceElement(FlowElement parent, FlowElementWrapper s,
 			FlowElement d) {
 		if (parent != null) {
-			List<FlowElement> l = parent.elements();
-			for (int i = 0; i < l.size(); i++) {
-				if (l.get(i) == s) {
-					l.set(i, d);
-					break;
+			synchronized(parent) {
+				List<FlowElement> l = parent.elements();
+				for (int i = 0; i < l.size(); i++) {
+					if (l.get(i) == s) {
+						l.set(i, d);
+						break;
+					}
 				}
 			}
 		}



More information about the Swift-commit mailing list