We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
catch_unwind
1 parent 47d0cbc commit 079f999Copy full SHA for 079f999
std/src/rt.rs
@@ -144,6 +144,10 @@ fn lang_start_internal(
144
rtabort!("drop of the panic payload panicked");
145
});
146
panic::catch_unwind(cleanup).map_err(rt_abort)?;
147
+ // Guard against multple threads calling `libc::exit` concurrently.
148
+ // See the documentation for `unique_thread_exit` for more information.
149
+ panic::catch_unwind(|| crate::sys::common::exit_guard::unique_thread_exit())
150
+ .map_err(rt_abort)?;
151
ret_code
152
}
153
@@ -161,8 +165,5 @@ fn lang_start<T: crate::process::Termination + 'static>(
161
165
argv,
162
166
sigpipe,
163
167
);
164
- // 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();
168
v
169
0 commit comments