Hmm, I'm having trouble following this. Is the intent here that if a thread's `exit_code` has already been set, it will only be overwritten in `terminate_process()` by a non-zero process exit code?
Yes, there are various race conditions when multiple threads terminate at the same time, and we want to make sure that failures are reported.