/src/test/run-pass/threads.rs
http://github.com/jruderman/rust · Rust · 13 lines · 8 code · 4 blank · 1 comment · 1 complexity · 63dbba804d5524573abd50af0f2f2d24 MD5 · raw file
- // -*- rust -*-
- use std;
- import task;
- fn main() {
- let mut i = 10;
- while i > 0 { task::spawn(|copy i| child(i) ); i = i - 1; }
- debug!{"main thread exiting"};
- }
- fn child(&&x: int) { log(debug, x); }