vm: don't SIGQUIT on unix or Ctrl-Break on windows

This gives us an escape hatch for when things go way south and ^C can't be handled. Also unmask SIGQUIT and SIGTERM from the stdin_loop thread so the thread doesn't keep the process alive after those signals.
db4
Joe Groff 2011-11-10 13:46:44 -08:00
parent e29c4589c4
commit 9e4a51c55f
2 changed files with 12 additions and 12 deletions

View File

@ -337,7 +337,6 @@ void factor_vm::unix_init_signals()
#endif #endif
init_sigaction_with_handler(&fep_sigaction, fep_signal_handler); init_sigaction_with_handler(&fep_sigaction, fep_signal_handler);
sigaction_safe(SIGQUIT,&fep_sigaction,NULL);
sigaction_safe(SIGINT,&fep_sigaction,NULL); sigaction_safe(SIGINT,&fep_sigaction,NULL);
init_sigaction_with_handler(&sample_sigaction, sample_signal_handler); init_sigaction_with_handler(&sample_sigaction, sample_signal_handler);
@ -431,6 +430,8 @@ void *stdin_loop(void *arg)
sigfillset(&mask); sigfillset(&mask);
sigdelset(&mask, SIGUSR2); sigdelset(&mask, SIGUSR2);
sigdelset(&mask, SIGTTIN); sigdelset(&mask, SIGTTIN);
sigdelset(&mask, SIGTERM);
sigdelset(&mask, SIGQUIT);
pthread_sigmask(SIG_SETMASK, &mask, NULL); pthread_sigmask(SIG_SETMASK, &mask, NULL);
while(loop_running) while(loop_running)

View File

@ -280,7 +280,6 @@ static BOOL WINAPI ctrl_handler(DWORD dwCtrlType)
{ {
switch (dwCtrlType) { switch (dwCtrlType) {
case CTRL_C_EVENT: case CTRL_C_EVENT:
case CTRL_BREAK_EVENT:
{ {
/* The CtrlHandler runs in its own thread without stopping the main thread. /* The CtrlHandler runs in its own thread without stopping the main thread.
Since in practice nobody uses the multi-VM stuff yet, we just grab the first Since in practice nobody uses the multi-VM stuff yet, we just grab the first