blob: 82b751b3b0b3966dab12bf36b3ecb39b32fe9948 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/*
A simple way to make sure threading works. This should use all the
CPU cycles an any machines that we're likely to see for a while.
*/
// xfail-test
use std;
import 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); }
loop { }
}
fn main() { let t: task = spawn loop(5); join(t); }
|