File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,10 @@ fn lang_start_internal(
144144 rtabort ! ( "drop of the panic payload panicked" ) ;
145145 } ) ;
146146 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) ?;
147151 ret_code
148152}
149153
@@ -161,8 +165,5 @@ fn lang_start<T: crate::process::Termination + 'static>(
161165 argv,
162166 sigpipe,
163167 ) ;
164- // Guard against multple threads calling `libc::exit` concurrently.
165- // See the documentation for `unique_thread_exit` for more information.
166- crate :: sys:: common:: exit_guard:: unique_thread_exit ( ) ;
167168 v
168169}
You can’t perform that action at this time.
0 commit comments