Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created May 3, 2018 21:04
Show Gist options
  • Save rust-play/84e17dfcb5a44f21ac1fdfb7b27fa1f5 to your computer and use it in GitHub Desktop.
Save rust-play/84e17dfcb5a44f21ac1fdfb7b27fa1f5 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#[warn(unused_variables)]
#[warn(unused_must_use)]
use std::thread;
fn main(){
let mut c = vec![];
for i in 0..10{
c.push(thread::spawn(move || {
println!("thread number {}", i);
}));
}
for _j in c {
_j.join();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment