[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 3039c55 2/4: Do not block sw interrupts in batch mod
From: |
Andrea Corallo |
Subject: |
feature/native-comp 3039c55 2/4: Do not block sw interrupts in batch mode (don't ignore C-c) |
Date: |
Thu, 2 Jan 2020 17:12:39 -0500 (EST) |
branch: feature/native-comp
commit 3039c55642fbb2feb577e057ee167c2cedc12feb
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>
Do not block sw interrupts in batch mode (don't ignore C-c)
---
src/comp.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/comp.c b/src/comp.c
index c25b324..bb8b952 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -3110,16 +3110,19 @@ DEFUN ("comp--compile-ctxt-to-file",
Fcomp__compile_ctxt_to_file,
gcc_jit_context_set_int_option (comp.ctxt,
GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
SPEED);
- /* Gcc doesn't like being interrupted at all. */
- block_input ();
sigset_t oldset;
- sigset_t blocked;
- sigemptyset (&blocked);
- sigaddset (&blocked, SIGALRM);
- sigaddset (&blocked, SIGINT);
- sigaddset (&blocked, SIGIO);
- pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
+ if (!noninteractive)
+ {
+ sigset_t blocked;
+ /* Gcc doesn't like being interrupted at all. */
+ block_input ();
+ sigemptyset (&blocked);
+ sigaddset (&blocked, SIGALRM);
+ sigaddset (&blocked, SIGINT);
+ sigaddset (&blocked, SIGIO);
+ pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
+ }
emit_ctxt_code ();
/* Define inline functions. */
@@ -3164,8 +3167,11 @@ DEFUN ("comp--compile-ctxt-to-file",
Fcomp__compile_ctxt_to_file,
Fdelete_file (out_file, Qnil);
Frename_file (tmp_file, out_file, Qnil);
- pthread_sigmask (SIG_SETMASK, &oldset, 0);
- unblock_input ();
+ if (!noninteractive)
+ {
+ pthread_sigmask (SIG_SETMASK, &oldset, 0);
+ unblock_input ();
+ }
return out_file;
}