2014-02-07 13:08:32 -06:00
|
|
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
2012-12-10 19:32:48 -06:00
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2011-06-20 19:19:50 -05:00
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
2014-02-07 13:08:32 -06:00
|
|
|
// ignore-test
|
2011-06-20 19:19:50 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn loopy(n: isize) {
|
2014-11-26 07:12:18 -06:00
|
|
|
if n > 0 { spawn(move|| { loopy(n - 1) }); spawn(move|| { loopy(n - 1) }); }
|
2012-03-09 18:11:56 -06:00
|
|
|
loop { }
|
2011-06-20 19:19:50 -05:00
|
|
|
}
|
2011-07-27 07:19:39 -05:00
|
|
|
|
2013-05-03 18:25:04 -05:00
|
|
|
pub fn main() {
|
2013-04-28 14:33:41 -05:00
|
|
|
// 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.
|
2014-11-26 07:12:18 -06:00
|
|
|
// spawn(move|| { loopy(5) });
|
2013-04-28 14:33:41 -05:00
|
|
|
}
|