[Swift-commit] r2426 - in trunk/src/org/griphyn/vdl/karajan: . lib

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sat Jan 10 03:53:10 CST 2009


Author: benc
Date: 2009-01-10 03:52:47 -0600 (Sat, 10 Jan 2009)
New Revision: 2426

Modified:
   trunk/src/org/griphyn/vdl/karajan/DSHandleFutureWrapper.java
   trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java
Log:
more locks to make previously committed asserts happy

Modified: trunk/src/org/griphyn/vdl/karajan/DSHandleFutureWrapper.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/DSHandleFutureWrapper.java	2009-01-10 01:22:41 UTC (rev 2425)
+++ trunk/src/org/griphyn/vdl/karajan/DSHandleFutureWrapper.java	2009-01-10 09:52:47 UTC (rev 2426)
@@ -74,7 +74,7 @@
 		listeners = null;
 	}
 
-	public int listenerCount() {
+	public synchronized int listenerCount() {
 		if (listeners == null) {
 			return 0;
 		}
@@ -83,7 +83,7 @@
 		}
 	}
 
-	public EventTargetPair[] getListenerEvents() {
+	public synchronized EventTargetPair[] getListenerEvents() {
 		if (listeners != null) {
 			return (EventTargetPair[]) listeners.toArray(new EventTargetPair[0]);
 		}

Modified: trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java	2009-01-10 01:22:41 UTC (rev 2425)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SwiftArg.java	2009-01-10 09:52:47 UTC (rev 2426)
@@ -36,17 +36,19 @@
 			DSHandle handle = (DSHandle) val;
 			if (handle.getType().isArray()) {
 				Map value = handle.getArrayValue();
-				if (handle.isClosed()) {
-					return new PairIterator(value);
+				synchronized(handle.getRoot()) {
+					if (handle.isClosed()) {
+						return new PairIterator(value);
+					}
+					else {
+						return VDLFunction.addFutureListListener(stack, handle, value);
+					}
 				}
-				else {
-					return VDLFunction.addFutureListListener(stack, handle, value);
-				}
 			}
 			if (logger.isDebugEnabled()) {
 				logger.debug("SwiftArg.getValue(" + handle + ")");
 			}
-			synchronized (handle) {
+			synchronized (handle.getRoot()) {
 				if (!handle.isClosed()) {
 					if (logger.isDebugEnabled()) {
 						logger.debug("Waiting for " + handle);




More information about the Swift-commit mailing list