Move exit guard from sys::common::exit_guard to sys::exit_guard.
This commit is contained in:
parent
9de76e3201
commit
a609370143
5 changed files with 3 additions and 4 deletions
|
|
@ -146,8 +146,7 @@ fn lang_start_internal(
|
|||
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)?;
|
||||
panic::catch_unwind(|| crate::sys::exit_guard::unique_thread_exit()).map_err(rt_abort)?;
|
||||
ret_code
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
/// descriptors.
|
||||
mod pal;
|
||||
|
||||
pub(crate) mod exit_guard;
|
||||
mod personality;
|
||||
|
||||
pub mod backtrace;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
pub mod alloc;
|
||||
pub mod exit_guard;
|
||||
pub mod small_c_string;
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
|
|
@ -758,7 +758,7 @@ pub fn home_dir() -> Option<PathBuf> {
|
|||
}
|
||||
|
||||
pub fn exit(code: i32) -> ! {
|
||||
crate::sys::common::exit_guard::unique_thread_exit();
|
||||
crate::sys::exit_guard::unique_thread_exit();
|
||||
unsafe { libc::exit(code as c_int) }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue