diff options
| author | Jim Blandy | 1993-05-10 00:14:09 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-10 00:14:09 +0000 |
| commit | 40a4095a69a5b10047d17fdb0af77123fdcde10f (patch) | |
| tree | faea4fbd243102a5501c90a66725e8a18de2bcd7 /src/blockinput.h | |
| parent | d70fd7d6ee50f1c0e9d7df7c430fa3d1efa71876 (diff) | |
| download | emacs-40a4095a69a5b10047d17fdb0af77123fdcde10f.tar.gz emacs-40a4095a69a5b10047d17fdb0af77123fdcde10f.zip | |
* 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.
Diffstat (limited to 'src/blockinput.h')
| -rw-r--r-- | src/blockinput.h | 25 |
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 |