Mercurial > hg > Database > Alice
view src/main/java/alice/test/concurrent/SleepCodeSegment.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | aefbe41fcf12 |
line wrap: on
line source
package alice.test.concurrent; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class SleepCodeSegment extends CodeSegment { public Receiver ds1 = ids.create(CommandType.TAKE); private int num; public SleepCodeSegment(int i) { this.num = i; } @Override public void run() { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("[CodeSegment-" + num + "] Hello, World!"); ods.put("local", "finish", ValueFactory.createNilValue()); } }