mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Move unique_thread_exit call to lang_start_internal so it is not in a generic function, and wrap it in catch_unwind
This commit is contained in:
parent
b512608275
commit
b4149c6ad4
@ -144,6 +144,10 @@ fn lang_start_internal(
|
||||
rtabort!("drop of the panic payload panicked");
|
||||
});
|
||||
panic::catch_unwind(cleanup).map_err(rt_abort)?;
|
||||
// Guard against multple threads calling `libc::exit` concurrently.
|
||||
// See the documentation for `unique_thread_exit` for more information.
|
||||
panic::catch_unwind(|| crate::sys::common::exit_guard::unique_thread_exit())
|
||||
.map_err(rt_abort)?;
|
||||
ret_code
|
||||
}
|
||||
|
||||
@ -161,8 +165,5 @@ fn lang_start<T: crate::process::Termination + 'static>(
|
||||
argv,
|
||||
sigpipe,
|
||||
);
|
||||
// Guard against multple threads calling `libc::exit` concurrently.
|
||||
// See the documentation for `unique_thread_exit` for more information.
|
||||
crate::sys::common::exit_guard::unique_thread_exit();
|
||||
v
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user