-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DL-APA
committed
Dec 7, 2022
1 parent
8e082e5
commit 4a3e5c2
Showing
1 changed file
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
use std::thread; | ||
|
||
mod d1; | ||
mod d2; | ||
mod d3; | ||
mod d4; | ||
mod d5; | ||
mod d6; | ||
|
||
fn main() { | ||
d1::run(); | ||
d2::run(); | ||
d3::run(); | ||
d4::run(); | ||
d5::run(); | ||
d6::run(); | ||
let mut handles = vec![]; | ||
|
||
for i in 1..6 { | ||
let handle = thread::spawn(move || match i { | ||
1 => d1::run(), | ||
2 => d2::run(), | ||
3 => d3::run(), | ||
4 => d4::run(), | ||
5 => d5::run(), | ||
6 => d6::run(), | ||
_ => println!("No such day"), | ||
}); | ||
handles.push(handle); | ||
} | ||
|
||
for handle in handles { | ||
handle.join().unwrap(); | ||
} | ||
} |