Updated spawn / loop thread to work with current syntax
This commit is contained in:
parent
212d77efcc
commit
e9814da3c0
1 changed files with 8 additions and 9 deletions
|
|
@ -15,16 +15,15 @@
|
|||
// xfail-test
|
||||
|
||||
extern mod std;
|
||||
use task::join;
|
||||
|
||||
fn loop(n: int) {
|
||||
let t1: task;
|
||||
let t2: task;
|
||||
|
||||
if n > 0 { t1 = spawn loop(n - 1); t2 = spawn loop(n - 1); }
|
||||
|
||||
|
||||
fn loopy(n: int) {
|
||||
if n > 0 { do spawn { loopy(n - 1) }; do spawn { loopy(n - 1) }; }
|
||||
loop { }
|
||||
}
|
||||
|
||||
pub fn main() { let t: task = spawn loop(5); join(t); }
|
||||
pub fn main() {
|
||||
// Commenting this out, as this will hang forever otherwise.
|
||||
// Even after seeing the comment above, I'm not sure what the
|
||||
// intention of this test is.
|
||||
// do spawn { loopy(5) };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue