[Swift-commit] r7482 - trunk/src/org/griphyn/vdl/mapping

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Fri Jan 17 00:04:39 CST 2014


Author: hategan
Date: 2014-01-17 00:04:39 -0600 (Fri, 17 Jan 2014)
New Revision: 7482

Modified:
   trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
   trunk/src/org/griphyn/vdl/mapping/ArrayDataNode.java
   trunk/src/org/griphyn/vdl/mapping/MappingParamSet.java
   trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
Log:
while a fully settled issue, added a flag to addListener to specify that notifications should only be sent about full closes (instead of partial array updates); this has no effect on non-arrays, but it can avoid infinite recursion if a piece of code is repeatedly adding listeners to a list of open things (also bug 1171)

Modified: trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2014-01-17 05:46:27 UTC (rev 7481)
+++ trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2014-01-17 06:04:39 UTC (rev 7482)
@@ -717,6 +717,10 @@
     }
     
     public void addListener(FutureListener l) {
+        addListener(l, true);
+    }
+    
+    public void addListener(FutureListener l, boolean partialUpdates) {
     	boolean closed;
     	WaitingThreadsMonitor.addThread(l, this);
     	synchronized(this) {

Modified: trunk/src/org/griphyn/vdl/mapping/ArrayDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/ArrayDataNode.java	2014-01-17 05:46:27 UTC (rev 7481)
+++ trunk/src/org/griphyn/vdl/mapping/ArrayDataNode.java	2014-01-17 06:04:39 UTC (rev 7482)
@@ -104,12 +104,12 @@
     }
     
     @Override
-    public void addListener(FutureListener l) {
+    public void addListener(FutureListener l, boolean partialUpdates) {
         boolean shouldNotify;
         WaitingThreadsMonitor.addThread(l, this);
         synchronized(this) {
             shouldNotify = addListener0(l);
-            if (keyList != null) {
+            if (keyList != null && partialUpdates) {
                 shouldNotify = true;
             }
         }

Modified: trunk/src/org/griphyn/vdl/mapping/MappingParamSet.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/MappingParamSet.java	2014-01-17 05:46:27 UTC (rev 7481)
+++ trunk/src/org/griphyn/vdl/mapping/MappingParamSet.java	2014-01-17 06:04:39 UTC (rev 7482)
@@ -45,7 +45,7 @@
     
     protected boolean checkOpen(Object v) {
         if (v instanceof AbstractDataNode && !((AbstractDataNode) v).isClosed()) {
-            return true;        
+            return true;
         }
         else {
             return false;

Modified: trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java	2014-01-17 05:46:27 UTC (rev 7481)
+++ trunk/src/org/griphyn/vdl/mapping/RootArrayDataNode.java	2014-01-17 06:04:39 UTC (rev 7482)
@@ -112,7 +112,7 @@
 	    
 		waitingMapperParam = mapper.getFirstOpenParameter();
         if (waitingMapperParam != null) {
-            waitingMapperParam.addListener(this);
+            waitingMapperParam.addListener(this, false);
             if (variableTracer.isEnabled()) {
                 variableTracer.trace(getThread(), getLine(), getName() + " WAIT " 
                     + Tracer.getVarName(waitingMapperParam));




More information about the Swift-commit mailing list