rust/src/test/run-pass/basic-1.rs

30 lines
549 B
Rust
Raw Normal View History

2010-08-09 06:53:37 -07:00
// -*- rust -*-
use std;
import std::comm::_chan;
import std::comm::mk_port;
import std::comm::send;
import std::task;
fn a(c: _chan<int>) { send(c, 10); }
2010-08-09 06:53:37 -07:00
2011-04-19 13:35:49 -07:00
fn main() {
let p = mk_port();
task::_spawn(bind a(p.mk_chan()));
task::_spawn(bind b(p.mk_chan()));
2011-07-27 14:19:39 +02:00
let n: int = 0;
n = p.recv();
n = p.recv();
2011-07-27 14:19:39 +02:00
// log "Finished.";
2010-08-09 06:53:37 -07:00
}
fn b(c: _chan<int>) {
2011-07-27 14:19:39 +02:00
// log "task b0";
// log "task b1";
// log "task b2";
// log "task b3";
// log "task b4";
// log "task b5";
send(c, 10);
}