X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/18e6fec08956d95a3fd1b4b1ef2a7bb9620c5fcf..ccf679adb3790903849f7d85b970b67582220952:/src/part12.rs?ds=inline 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();