]>
Commit | Line | Data |
---|---|---|
1a4d82fc | 1 | // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT |
223e47cc LB |
2 | // file at the top-level directory of this distribution and at |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
11 | /* | |
12 | A simple way to make sure threading works. This should use all the | |
13 | CPU cycles an any machines that we're likely to see for a while. | |
14 | */ | |
1a4d82fc | 15 | // ignore-test |
223e47cc | 16 | |
c34b1796 | 17 | fn loopy(n: isize) { |
1a4d82fc | 18 | if n > 0 { spawn(move|| { loopy(n - 1) }); spawn(move|| { loopy(n - 1) }); } |
223e47cc LB |
19 | loop { } |
20 | } | |
21 | ||
970d7e83 LB |
22 | pub fn main() { |
23 | // Commenting this out, as this will hang forever otherwise. | |
24 | // Even after seeing the comment above, I'm not sure what the | |
25 | // intention of this test is. | |
1a4d82fc | 26 | // spawn(move|| { loopy(5) }); |
970d7e83 | 27 | } |