class Chef extends MyObject implements CSProcess{
private ChannelOutputInt toCanteen = null;
public Chef(ChannelOutputInt toCanteen){
this.toCanteen = toCanteen;
}
public void run(){
int numChicks = 4;
while(true){
nap(2000); // Cooking
toCanteen.write(numChicks);// Delivering
toCanteen.write(0); // 4 chickens up
}
}
}
Previous slide | Next slide | Back to first slide | View graphic version |