add Context.startupLoopFactories
authoradam <adam@megacz.com>
Mon, 3 Nov 2008 10:16:26 +0000 (11:16 +0100)
committeradam <adam@megacz.com>
Mon, 3 Nov 2008 10:16:26 +0000 (11:16 +0100)
src/edu/berkeley/fleet/ir/Context.java

index d26c0cb..f973e87 100644 (file)
@@ -40,7 +40,7 @@ import static edu.berkeley.fleet.util.BitManipulations.*;
  *        - after executing these remaining instructions, the dock's hatch is open
  */
 public class Context {
-
+    private HashMap<Dock,LoopFactory> startupLoopFactories = new HashMap<Dock,LoopFactory>();
     private HashSet<LoopFactory> loopFactories = new HashSet<LoopFactory>();
 
     public final Fleet fleet;
@@ -96,6 +96,8 @@ public class Context {
             this.count = count;
             this.friendlyName = friendlyName;
             Context.this.loopFactories.add(this);
+            if (Context.this.startupLoopFactories.get(dock) == null)
+                Context.this.startupLoopFactories.put(dock, this);
             if (prev != null) {
                 if (prev.getNext() != null) throw new RuntimeException();
                 prev.setNext(this);