rust/src/test/run-pass/infinite-loops.rs
Tim Chevalier 321fd80219 Add an infinite loop construct
Add a loop {} construct for infinite loops, and use it in test
cases. See #1906 for details.
2012-03-09 16:40:58 -08:00

20 lines
375 B
Rust

/*
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); }