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