I know that if a thread panics while it is panicking, that it will abort the program. However, today I saw someone make the claim that two independent threads simultaneously panicking will abort the process as well. Is it actually true that two independent threads panicking simultaneously will abort the process, the same as a single thread panicking twice?
This will not abort the process. The panicking/unwinding status of each thread is independent. Two threads both panicking at the same time will:
JoinHandles,and an application could, of course, choose to abort if it sees multiple such panics, but there is nothing in the Rust standard library or compiler that will cause an abort in this case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With