[Swift-commit] r2351 - trunk/src/org/griphyn/vdl/karajan/lib

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Nov 28 00:52:56 CST 2008


Author: benc
Date: 2008-11-28 00:52:55 -0600 (Fri, 28 Nov 2008)
New Revision: 2351

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/FringePaths.java
Log:
lock root of datasets when getting fringe paths - this will be needed in a future commit to prevent a race condition

Modified: trunk/src/org/griphyn/vdl/karajan/lib/FringePaths.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/FringePaths.java	2008-11-27 23:26:40 UTC (rev 2350)
+++ trunk/src/org/griphyn/vdl/karajan/lib/FringePaths.java	2008-11-28 06:52:55 UTC (rev 2351)
@@ -24,16 +24,22 @@
 
 	public Object function(VariableStack stack) throws ExecutionException {
 		DSHandle var = (DSHandle) PA_VAR.getValue(stack);
+		DSHandle root = var.getRoot();
 		try {
 			var = var.getField(parsePath(OA_PATH.getValue(stack), stack));
-			Collection c = var.getFringePaths();
+			Collection c;
+			synchronized(root) {
+				c = var.getFringePaths();
+			}
 			return c;
 		}
 		catch (InvalidPathException e) {
 			throw new ExecutionException(e);
 		}
 		catch (HandleOpenException e) {
-			throw new FutureNotYetAvailable(addFutureListener(stack, e.getSource()));
+			synchronized(root) {
+				throw new FutureNotYetAvailable(addFutureListener(stack, e.getSource()));
+			}
 		}
 	}
 }




More information about the Swift-commit mailing list