From: adam Date: Sun, 28 Jan 2007 06:59:13 +0000 (+0100) Subject: fix bug in Inbox (thank Dominic) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=21df60b66604c42faee4d56f71618da46bcd1c1e;p=fleet.git fix bug in Inbox (thank Dominic) --- diff --git a/src/edu/berkeley/fleet/interpreter/Inbox.java b/src/edu/berkeley/fleet/interpreter/Inbox.java index cc74b83..b6fe7c4 100644 --- a/src/edu/berkeley/fleet/interpreter/Inbox.java +++ b/src/edu/berkeley/fleet/interpreter/Inbox.java @@ -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);