view src/alice/topology/manager/ConfigWaiter.java @ 35:ac3b48c5f4da

share width each other with tree
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Fri, 20 Jan 2012 04:00:12 +0900
parents
children 23e53aaa8720
line wrap: on
line source

package alice.topology.manager;

import org.msgpack.type.ValueFactory;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;

public class ConfigWaiter extends CodeSegment {
	
	public Receiver done = ids.create(CommandType.TAKE);
	public int count;
	
	public ConfigWaiter(int nodeNum) {
		this.count = nodeNum;
	}

	@Override
	public void run() {
		count--;
		if (count == 0) {
			ods.put("local", "start", ValueFactory.createNilValue());
			return;
		}
		ConfigWaiter cs3 = new ConfigWaiter(count);
		cs3.done.setKey("local", "done");
	}

}