fix bug in Inbox (thank Dominic)
authoradam <adam@megacz.com>
Sun, 28 Jan 2007 06:59:13 +0000 (07:59 +0100)
committeradam <adam@megacz.com>
Sun, 28 Jan 2007 06:59:13 +0000 (07:59 +0100)
src/edu/berkeley/fleet/interpreter/Inbox.java

index cc74b83..b6fe7c4 100644 (file)
@@ -65,6 +65,7 @@ public class Inbox extends InstructionPort {
         if (instruction.tokenIn)
             throw new RuntimeException("invalid instruction: " + instruction +
                                        " (attempts to use trigger on an inbox)");
+
         if (instruction.dataIn && itemsFromFabric.size()==0) return false;
 
         // consume inbound data+token
@@ -80,10 +81,10 @@ public class Inbox extends InstructionPort {
             itemReadyForShip = true;
 
             // and make note of the fact that we need to send an ack (if requested)
-            if (instruction.tokenIn)
+            if (instruction.tokenOut)
                 ackDestinationUponAccept = (InterpreterBenkoBox)instruction.dest;
 
-        } else if (instruction.tokenIn) {
+        } else if (instruction.tokenOut) {
 
             // if dataOut is not set, we can send the data immediately
             getInterpreter().sendToken(this, (InterpreterBenkoBox)instruction.dest);