X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/18e6fec08956d95a3fd1b4b1ef2a7bb9620c5fcf..98dafe0138b8bf6584b8d9e86a74a580bb034a26:/src/part12.rs diff --git a/src/part12.rs b/src/part12.rs index 3e959f9..dc0da61 100644 --- a/src/part12.rs +++ b/src/part12.rs @@ -124,6 +124,9 @@ pub fn run(options: Options) { let handle3 = thread::spawn(move || output_lines(options3, filtered_receiver)); // Finally, wait until all three threads did their job. + //@ Joining a thread waits for its termination. This can fail if that thread panicked: In this case, we could get + //@ access to the data that it provided to `panic!`. Here, we just assert that they did not panic - so we will panic ourselves + //@ if that happened. handle1.join().unwrap(); handle2.join().unwrap(); handle3.join().unwrap();