mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 12:13:55 +08:00
debug_thread_error to wait for a signal instead of sleep
Allows for control-C out of it
This commit is contained in:
parent
6d20b3984a
commit
363652ad76
|
@ -2269,7 +2269,11 @@ void append_path_component(wcstring &path, const wcstring &component) {
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
[[gnu::noinline]] void debug_thread_error(void) {
|
[[gnu::noinline]] void debug_thread_error(void) {
|
||||||
while (1) sleep(9999999);
|
// Wait for a SIGINT. We can't use sigsuspend() because the signal may be delivered on another
|
||||||
|
// thread.
|
||||||
|
auto &tm = topic_monitor_t::principal();
|
||||||
|
auto gens = tm.current_generations();
|
||||||
|
tm.check(&gens, {topic_t::sighupint}, true /* wait */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,6 +255,7 @@ static void handle_int_notinteractive(int sig, siginfo_t *info, void *context) {
|
||||||
if (reraise_if_forked_child(sig)) return;
|
if (reraise_if_forked_child(sig)) return;
|
||||||
parser_t::skip_all_blocks();
|
parser_t::skip_all_blocks();
|
||||||
default_handler(sig, info, context);
|
default_handler(sig, info, context);
|
||||||
|
topic_monitor_t::principal().post(topic_t::sighupint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// sigchld handler. Does notification and calls the handler in proc.c.
|
/// sigchld handler. Does notification and calls the handler in proc.c.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user