diff options
| author | Chong Yidong | 2009-01-29 14:34:16 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-01-29 14:34:16 +0000 |
| commit | ceb18827064f5483320e48bd8b9427aa40966d47 (patch) | |
| tree | 0844bcd00b21af0fb5627a9672038196801b9fec /src | |
| parent | 325530dec76c10dfa64f3a9e5ddc521906609059 (diff) | |
| download | emacs-ceb18827064f5483320e48bd8b9427aa40966d47.tar.gz emacs-ceb18827064f5483320e48bd8b9427aa40966d47.zip | |
(pending_signals): New var.
(poll_for_input, input_available_signal, init_keyboard): Set it.
(process_pending_signals): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index cae40ffd85e..8e3d51b7e77 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -91,6 +91,13 @@ volatile int interrupt_input_blocked; | |||
| 91 | during the current critical section. */ | 91 | during the current critical section. */ |
| 92 | int interrupt_input_pending; | 92 | int interrupt_input_pending; |
| 93 | 93 | ||
| 94 | /* This var should be (interrupt_input_pending || pending_atimers). | ||
| 95 | The QUIT macro checks this instead of interrupt_input_pending and | ||
| 96 | pending_atimers separately, to reduce code size. So, any code that | ||
| 97 | changes interrupt_input_pending or pending_atimers should update | ||
| 98 | this too. */ | ||
| 99 | int pending_signals; | ||
| 100 | |||
| 94 | #define KBD_BUFFER_SIZE 4096 | 101 | #define KBD_BUFFER_SIZE 4096 |
| 95 | 102 | ||
| 96 | KBOARD *initial_kboard; | 103 | KBOARD *initial_kboard; |
| @@ -2193,11 +2200,14 @@ poll_for_input (timer) | |||
| 2193 | struct atimer *timer; | 2200 | struct atimer *timer; |
| 2194 | { | 2201 | { |
| 2195 | if (poll_suppress_count == 0) | 2202 | if (poll_suppress_count == 0) |
| 2203 | { | ||
| 2196 | #ifdef SYNC_INPUT | 2204 | #ifdef SYNC_INPUT |
| 2197 | interrupt_input_pending = 1; | 2205 | interrupt_input_pending = 1; |
| 2206 | pending_signals = 1; | ||
| 2198 | #else | 2207 | #else |
| 2199 | poll_for_input_1 (); | 2208 | poll_for_input_1 (); |
| 2200 | #endif | 2209 | #endif |
| 2210 | } | ||
| 2201 | } | 2211 | } |
| 2202 | 2212 | ||
| 2203 | #endif /* POLL_FOR_INPUT */ | 2213 | #endif /* POLL_FOR_INPUT */ |
| @@ -7261,6 +7271,7 @@ void | |||
| 7261 | handle_async_input () | 7271 | handle_async_input () |
| 7262 | { | 7272 | { |
| 7263 | interrupt_input_pending = 0; | 7273 | interrupt_input_pending = 0; |
| 7274 | pending_signals = pending_atimers; | ||
| 7264 | 7275 | ||
| 7265 | while (1) | 7276 | while (1) |
| 7266 | { | 7277 | { |
| @@ -7274,6 +7285,14 @@ handle_async_input () | |||
| 7274 | } | 7285 | } |
| 7275 | } | 7286 | } |
| 7276 | 7287 | ||
| 7288 | void | ||
| 7289 | process_pending_signals () | ||
| 7290 | { | ||
| 7291 | if (interrupt_input_pending) | ||
| 7292 | handle_async_input (); | ||
| 7293 | do_pending_atimers (); | ||
| 7294 | } | ||
| 7295 | |||
| 7277 | #ifdef SIGIO /* for entire page */ | 7296 | #ifdef SIGIO /* for entire page */ |
| 7278 | /* Note SIGIO has been undef'd if FIONREAD is missing. */ | 7297 | /* Note SIGIO has been undef'd if FIONREAD is missing. */ |
| 7279 | 7298 | ||
| @@ -7291,6 +7310,7 @@ input_available_signal (signo) | |||
| 7291 | 7310 | ||
| 7292 | #ifdef SYNC_INPUT | 7311 | #ifdef SYNC_INPUT |
| 7293 | interrupt_input_pending = 1; | 7312 | interrupt_input_pending = 1; |
| 7313 | pending_signals = 1; | ||
| 7294 | #else | 7314 | #else |
| 7295 | SIGNAL_THREAD_CHECK (signo); | 7315 | SIGNAL_THREAD_CHECK (signo); |
| 7296 | #endif | 7316 | #endif |
| @@ -11536,6 +11556,7 @@ init_keyboard () | |||
| 11536 | input_pending = 0; | 11556 | input_pending = 0; |
| 11537 | interrupt_input_blocked = 0; | 11557 | interrupt_input_blocked = 0; |
| 11538 | interrupt_input_pending = 0; | 11558 | interrupt_input_pending = 0; |
| 11559 | pending_signals = 0; | ||
| 11539 | 11560 | ||
| 11540 | /* This means that command_loop_1 won't try to select anything the first | 11561 | /* This means that command_loop_1 won't try to select anything the first |
| 11541 | time through. */ | 11562 | time through. */ |