comparison src/blockinput.h @ 2721:ca5cb6cafc40

* blockinput.h (UNBLOCK_INPUT): We cannot assume that SIGIO is defined everywhere this file is #included; merge the two definitions for defined (SIGIO) and ! defined (SIGIO) into one, which calls reinvoke_input_signal if interrupt_input_pending is set. * keyboard.c (reinvoke_input_signal): New function.
author Jim Blandy <jimb@redhat.com>
date Mon, 10 May 1993 00:14:09 +0000
parents 6d011b24f6fe
children ee40177f6c68
comparison
equal deleted inserted replaced
2720:ad53bd625e1c 2721:ca5cb6cafc40
50 extern int interrupt_input_pending; 50 extern int interrupt_input_pending;
51 51
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