diff --git a/fish-rust/src/common.rs b/fish-rust/src/common.rs index 7f333a936..230983d70 100644 --- a/fish-rust/src/common.rs +++ b/fish-rust/src/common.rs @@ -947,6 +947,17 @@ pub const fn char_offset(base: char, offset: u32) -> char { } } +#[no_mangle] +#[inline(never)] +fn debug_thread_error() { + // Wait for a SIGINT. We can't use sigsuspend() because the signal may be delivered on another + // thread. + use crate::signal::SigChecker; + use crate::topic_monitor::topic_t; + let sigint = SigChecker::new(topic_t::sighupint); + sigint.wait(); +} + /// Exits without invoking destructors (via _exit), useful for code after fork. pub fn exit_without_destructors(code: i32) -> ! { unsafe { libc::_exit(code) }; diff --git a/src/common.cpp b/src/common.cpp index 53e8684c2..d93e2cf0a 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1364,14 +1364,7 @@ double timef() { void exit_without_destructors(int code) { _exit(code); } -extern "C" { -[[gnu::noinline]] void debug_thread_error(void) { - // Wait for a SIGINT. We can't use sigsuspend() because the signal may be delivered on another - // thread. - sigchecker_t sigint(topic_t::sighupint); - sigint.wait(); -} -} +extern "C" void debug_thread_error(); void save_term_foreground_process_group() { initial_fg_process_group = tcgetpgrp(STDIN_FILENO); }