Fix task-comm-15 type errors and un-xfail.
This commit is contained in:
parent
eb368d1b34
commit
0a00fab249
1 changed files with 3 additions and 7 deletions
|
@ -1,23 +1,19 @@
|
|||
// xfail-stage1
|
||||
// xfail-stage2
|
||||
// xfail-stage3
|
||||
|
||||
use std;
|
||||
import std::comm;
|
||||
import std::task;
|
||||
|
||||
fn start(c : comm::_chan<int>, n: int) {
|
||||
fn start(c : comm::chan<int>, n: int) {
|
||||
let i: int = n;
|
||||
|
||||
while i > 0 { comm::send(c, 0); i = i - 1; }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p = comm::mk_port::<comm::_chan<int>>();
|
||||
let p = comm::mk_port();
|
||||
// Spawn a task that sends us back messages. The parent task
|
||||
// is likely to terminate before the child completes, so from
|
||||
// the child's point of view the receiver may die. We should
|
||||
// drop messages on the floor in this case, and not crash!
|
||||
let child = task::_spawn(bind start(p.mk_chan(), 10));
|
||||
let child = task::spawn(bind start(p.mk_chan(), 10));
|
||||
let c = p.recv();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue