summaryrefslogtreecommitdiff
path: root/boehm-gc/linux_threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'boehm-gc/linux_threads.c')
-rw-r--r--boehm-gc/linux_threads.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/boehm-gc/linux_threads.c b/boehm-gc/linux_threads.c
index 8287dce647b..4d98062d11c 100644
--- a/boehm-gc/linux_threads.c
+++ b/boehm-gc/linux_threads.c
@@ -173,6 +173,11 @@ void GC_suspend_handler(int sig)
/* is no race. */
if (sigfillset(&mask) != 0) ABORT("sigfillset() failed");
if (sigdelset(&mask, SIG_RESTART) != 0) ABORT("sigdelset() failed");
+#ifdef NO_SIGNALS
+ if (sigdelset(&mask, SIGINT) != 0) ABORT("sigdelset() failed");
+ if (sigdelset(&mask, SIGQUIT) != 0) ABORT("sigdelset() failed");
+ if (sigdelset(&mask, SIGTERM) != 0) ABORT("sigdelset() failed");
+#endif
do {
me->signal = 0;
sigsuspend(&mask); /* Wait for signal */
@@ -433,6 +438,21 @@ void GC_thr_init()
if (sigfillset(&act.sa_mask) != 0) {
ABORT("sigfillset() failed");
}
+
+#ifdef NO_SIGNALS
+ if (sigdelset(&act.sa_mask, SIGINT) != 0) {
+ ABORT("sigdelset() failed");
+ }
+
+ if (sigdelset(&act.sa_mask, SIGQUIT) != 0) {
+ ABORT("sigdelset() failed");
+ }
+
+ if (sigdelset(&act.sa_mask, SIGTERM) != 0) {
+ ABORT("sigdelset() failed");
+ }
+#endif
+
/* SIG_RESTART is unmasked by the handler when necessary. */
act.sa_handler = GC_suspend_handler;
if (sigaction(SIG_SUSPEND, &act, NULL) != 0) {