Skip to content

Commit e9814da

Browse files
committed
Updated spawn / loop thread to work with current syntax
1 parent 212d77e commit e9814da

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/test/run-pass/infinite-loops.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
// xfail-test
1616

1717
extern mod std;
18-
use task::join;
19-
20-
fn loop(n: int) {
21-
let t1: task;
22-
let t2: task;
23-
24-
if n > 0 { t1 = spawn loop(n - 1); t2 = spawn loop(n - 1); }
25-
2618

19+
fn loopy(n: int) {
20+
if n > 0 { do spawn { loopy(n - 1) }; do spawn { loopy(n - 1) }; }
2721
loop { }
2822
}
2923

30-
pub fn main() { let t: task = spawn loop(5); join(t); }
24+
pub fn main() {
25+
// Commenting this out, as this will hang forever otherwise.
26+
// Even after seeing the comment above, I'm not sure what the
27+
// intention of this test is.
28+
// do spawn { loopy(5) };
29+
}

0 commit comments

Comments
 (0)