Created
May 3, 2018 21:04
-
-
Save rust-play/84e17dfcb5a44f21ac1fdfb7b27fa1f5 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[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