Skip to content

Instantly share code, notes, and snippets.

@maretekent
Forked from rust-play/playground.rs
Created May 4, 2018 09:34
Show Gist options
  • Save maretekent/9e73d808319023ebbe87c7e209303a0f to your computer and use it in GitHub Desktop.
Save maretekent/9e73d808319023ebbe87c7e209303a0f 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