PageRenderTime 68ms CodeModel.GetById 63ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1// -*- rust -*-
 2
 3use std;
 4import task;
 5
 6fn main() {
 7    let mut i = 10;
 8    while i > 0 { task::spawn(|copy i| child(i) ); i = i - 1; }
 9    debug!{"main thread exiting"};
10}
11
12fn child(&&x: int) { log(debug, x); }
13