Mercurial > hg > Database > Alice
view src/main/java/alice/test/concurrent/AliceFinish.java @ 655:1c93e82e05c6 default tip
fix timestamp
author | suruga |
---|---|
date | Sat, 17 Feb 2018 00:33:00 +0900 |
parents | 6e304a7a60e7 |
children | 15eeb439830c |
line wrap: on
line source
package alice.test.concurrent; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class AliceFinish extends CodeSegment { private int num; public Receiver ds1 = ids.create(CommandType.TAKE); public AliceFinish(int threadNum) { this.num = threadNum; } @Override public void run() { if (--num == 0) System.exit(0); AliceFinish cs1 = new AliceFinish(num); cs1.ds1.setKey("finish"); } }