Changeset - 6129d6c9c015
[Not reviewed]
0 1 0
Christopher Esterhuyse - 5 years ago 2020-02-07 10:55:20
christopheresterhuyse@gmail.com
more
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/test/connector.rs
Show inline comments
 
@@ -28,25 +28,26 @@ primitive alternator_2(in i, out a, out b) {
 
composite sync_2(in i, out o) {
 
    channel x -> y;
 
    new sync(i, x);
 
    new sync(y, o);
 
}
 
composite forward_pair(in ia, out oa, in ib, out ob) {
 
    new forward(ia, oa);
 
    new forward(ib, ob);
 
}
 
primitive forward_nonzero(in i, out o) {
 
    while(true) synchronous {
 
        msg m = get(i);
 
        if(m[0]==0) put(o, m);
 
        assert(m[0] != 0);
 
        put(o, m);
 
    }
 
}
 
primitive token_spout(out o) {
 
    while(true) synchronous {
 
        put(o, create(0));
 
    }
 
}
 
primitive wait_10(out o) {
 
    int i = 0;
 
    while(i < 10) {
 
        synchronous {}
 
        i += 1;
0 comments (0 inline, 0 general)