aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blockinput.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/blockinput.h b/src/blockinput.h
index f8b09419b7d..da20e7f1ee1 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -52,21 +52,26 @@ extern int interrupt_input_pending;
52/* Begin critical section. */ 52/* Begin critical section. */
53#define BLOCK_INPUT (interrupt_input_blocked++) 53#define BLOCK_INPUT (interrupt_input_blocked++)
54 54
55/* End critical section. */ 55/* End critical section.
56#ifdef SIGIO 56
57/* If doing interrupt input, and an interrupt came in when input was blocked, 57 If doing signal-driven input, and a signal came in when input was
58 reinvoke the interrupt handler now to deal with it. */ 58 blocked, reinvoke the signal handler now to deal with it.
59
60 We used to have two possible definitions of this macro - one for
61 when SIGIO was #defined, and one for when it wasn't; when SIGIO
62 wasn't #defined, we wouldn't bother to check if we should re-invoke
63 the signal handler. But that doesn't work very well; some of the
64 files which use this macro don't #include the right files to get
65 SIGIO.
66
67 So, we always test interrupt_input_pending now; that's not too
68 expensive, and it'll never get set if we don't need to resignal. */
59#define UNBLOCK_INPUT \ 69#define UNBLOCK_INPUT \
60 (interrupt_input_blocked--, \ 70 (interrupt_input_blocked--, \
61 (interrupt_input_blocked < 0 ? (abort (), 0) : 0), \ 71 (interrupt_input_blocked < 0 ? (abort (), 0) : 0), \
62 ((interrupt_input_blocked == 0 && interrupt_input_pending != 0) \ 72 ((interrupt_input_blocked == 0 && interrupt_input_pending != 0) \
63 ? (kill (0, SIGIO), 0) \ 73 ? (reinvoke_input_signal (), 0) \
64 : 0)) 74 : 0))
65#else
66#define UNBLOCK_INPUT \
67 (interrupt_input_blocked--, \
68 (interrupt_input_blocked < 0 ? (abort (), 0) : 0))
69#endif
70 75
71#define TOTALLY_UNBLOCK_INPUT (interrupt_input_blocked = 0) 76#define TOTALLY_UNBLOCK_INPUT (interrupt_input_blocked = 0)
72#define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT 77#define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT