-
-
Save maretekent/9e73d808319023ebbe87c7e209303a0f 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