send exit messages to threads
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Patrick Michl 2021-03-15 22:02:46 +01:00
parent 0d813cfb6f
commit 19f3a6daf5

View File

@ -52,8 +52,14 @@ fn main() -> Result<(), std::io::Error> {
for (x, y, p) in image.enumerate_pixels() {
let _ = sender.send(Message::Pixel(x, y, p.clone()));
}
(0..16).for_each(|_| {
let _ = sender.send(Message::Exit);
});
for thread in handles {
let _ = thread.join();
}
Ok(())
}