mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 22:04:26 +08:00
Port debug_thread_error() to Rust
This commit is contained in:
parent
38ac21ba5e
commit
76205e5b55
@ -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.
|
/// Exits without invoking destructors (via _exit), useful for code after fork.
|
||||||
pub fn exit_without_destructors(code: i32) -> ! {
|
pub fn exit_without_destructors(code: i32) -> ! {
|
||||||
unsafe { libc::_exit(code) };
|
unsafe { libc::_exit(code) };
|
||||||
|
@ -1364,14 +1364,7 @@ double timef() {
|
|||||||
|
|
||||||
void exit_without_destructors(int code) { _exit(code); }
|
void exit_without_destructors(int code) { _exit(code); }
|
||||||
|
|
||||||
extern "C" {
|
extern "C" void debug_thread_error();
|
||||||
[[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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void save_term_foreground_process_group() { initial_fg_process_group = tcgetpgrp(STDIN_FILENO); }
|
void save_term_foreground_process_group() { initial_fg_process_group = tcgetpgrp(STDIN_FILENO); }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user