Skip to content

Commit ad83070

Browse files
committed
---
yaml --- r: 5383 b: refs/heads/master c: c6d460d h: refs/heads/master i: 5381: 3a825e4 5379: 4098ac2 5375: 83e78ff v: v3
1 parent c666263 commit ad83070

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 564bdacecebd25e314c6785d7fff601b12c8e10f
2+
refs/heads/master: c6d460d4e3a9efc2f23b387e588816b404def9de
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
// xfail-test
2-
io fn main() {
3-
let port<int> po = port();
2+
use std;
3+
import std::comm;
4+
import std::task;
5+
6+
fn main() {
7+
let po = comm::port();
48

59
// Spawn 10 tasks each sending us back one int.
6-
let int i = 10;
10+
let i = 10;
711
while (i > 0) {
812
log i;
9-
spawn "child" child(i, chan(po));
13+
task::spawn(bind child(i, comm::chan(po)));
1014
i = i - 1;
1115
}
1216

1317
// Spawned tasks are likely killed before they get a chance to send
1418
// anything back, so we deadlock here.
1519

1620
i = 10;
17-
let int value = 0;
21+
let value = 0;
1822
while (i > 0) {
1923
log i;
20-
po |> value;
24+
value = comm::recv(po);
2125
i = i - 1;
2226
}
2327

2428
log "main thread exiting";
2529
}
2630

27-
io fn child(int x, chan<int> ch) {
31+
fn child(x: int, ch: comm::chan<int>) {
2832
log x;
29-
ch <| x;
33+
comm::send(ch, x);
3034
}

0 commit comments

Comments
 (0)