Commit 07a1e794 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

* atimer.c (run_timers, alarm_signal_handler):

* keyboard.c (pending_signals, handle_async_input, init_keyboard):
* w32inevt.c (w32_console_read_socket):
* w32term.c (w32_read_socket):
* xterm.c (XTread_socket): Use "#ifdef SYNC_INPUT" where appropriate.
parent 5e36bc05
2009-01-30 Juanma Barranquero <lekktu@gmail.com>
* atimer.c (run_timers, alarm_signal_handler):
* keyboard.c (pending_signals, handle_async_input, init_keyboard):
* w32inevt.c (w32_console_read_socket):
* w32term.c (w32_read_socket):
* xterm.c (XTread_socket): Use "#ifdef SYNC_INPUT" where appropriate.
2009-01-30 Chong Yidong <cyd@stupidchicken.com> 2009-01-30 Chong Yidong <cyd@stupidchicken.com>
   
* callproc.c (Vtemp_file_name_pattern): Remove DEFVAR_LISP. * callproc.c (Vtemp_file_name_pattern): Remove DEFVAR_LISP.
......
...@@ -384,6 +384,7 @@ run_timers () ...@@ -384,6 +384,7 @@ run_timers ()
EMACS_GET_TIME (now); EMACS_GET_TIME (now);
} }
#ifdef SYNC_INPUT
if (pending_atimers) if (pending_atimers)
pending_signals = 1; pending_signals = 1;
else else
...@@ -391,6 +392,10 @@ run_timers () ...@@ -391,6 +392,10 @@ run_timers ()
pending_signals = interrupt_input_pending; pending_signals = interrupt_input_pending;
set_alarm (); set_alarm ();
} }
#else
if (! pending_atimers)
set_alarm ();
#endif
} }
...@@ -402,8 +407,9 @@ alarm_signal_handler (signo) ...@@ -402,8 +407,9 @@ alarm_signal_handler (signo)
int signo; int signo;
{ {
pending_atimers = 1; pending_atimers = 1;
#ifdef SYNC_INPUT
pending_signals = 1; pending_signals = 1;
#ifndef SYNC_INPUT #else
run_timers (); run_timers ();
#endif #endif
} }
......
...@@ -96,7 +96,9 @@ int interrupt_input_pending; ...@@ -96,7 +96,9 @@ int interrupt_input_pending;
pending_atimers separately, to reduce code size. So, any code that pending_atimers separately, to reduce code size. So, any code that
changes interrupt_input_pending or pending_atimers should update changes interrupt_input_pending or pending_atimers should update
this too. */ this too. */
#ifdef SYNC_INPUT
int pending_signals; int pending_signals;
#endif
#define KBD_BUFFER_SIZE 4096 #define KBD_BUFFER_SIZE 4096
...@@ -7271,7 +7273,9 @@ void ...@@ -7271,7 +7273,9 @@ void
handle_async_input () handle_async_input ()
{ {
interrupt_input_pending = 0; interrupt_input_pending = 0;
#ifdef SYNC_INPUT
pending_signals = pending_atimers; pending_signals = pending_atimers;
#endif
while (1) while (1)
{ {
...@@ -11556,7 +11560,9 @@ init_keyboard () ...@@ -11556,7 +11560,9 @@ init_keyboard ()
input_pending = 0; input_pending = 0;
interrupt_input_blocked = 0; interrupt_input_blocked = 0;
interrupt_input_pending = 0; interrupt_input_pending = 0;
#ifdef SYNC_INPUT
pending_signals = 0; pending_signals = 0;
#endif
/* This means that command_loop_1 won't try to select anything the first /* This means that command_loop_1 won't try to select anything the first
time through. */ time through. */
......
...@@ -651,12 +651,16 @@ w32_console_read_socket (struct terminal *terminal, ...@@ -651,12 +651,16 @@ w32_console_read_socket (struct terminal *terminal,
if (interrupt_input_blocked) if (interrupt_input_blocked)
{ {
interrupt_input_pending = 1; interrupt_input_pending = 1;
#ifdef SYNC_INPUT
pending_signals = 1; pending_signals = 1;
#endif
return -1; return -1;
} }
interrupt_input_pending = 0; interrupt_input_pending = 0;
#ifdef SYNC_INPUT
pending_signals = pending_atimers; pending_signals = pending_atimers;
#endif
BLOCK_INPUT; BLOCK_INPUT;
for (;;) for (;;)
......
...@@ -4078,12 +4078,16 @@ w32_read_socket (sd, expected, hold_quit) ...@@ -4078,12 +4078,16 @@ w32_read_socket (sd, expected, hold_quit)
if (interrupt_input_blocked) if (interrupt_input_blocked)
{ {
interrupt_input_pending = 1; interrupt_input_pending = 1;
#ifdef SYNC_INPUT
pending_signals = 1; pending_signals = 1;
#endif
return -1; return -1;
} }
interrupt_input_pending = 0; interrupt_input_pending = 0;
#ifdef SYNC_INPUT
pending_signals = pending_atimers; pending_signals = pending_atimers;
#endif
BLOCK_INPUT; BLOCK_INPUT;
/* So people can tell when we have read the available input. */ /* So people can tell when we have read the available input. */
......
...@@ -7138,12 +7138,16 @@ XTread_socket (terminal, expected, hold_quit) ...@@ -7138,12 +7138,16 @@ XTread_socket (terminal, expected, hold_quit)
if (interrupt_input_blocked) if (interrupt_input_blocked)
{ {
interrupt_input_pending = 1; interrupt_input_pending = 1;
#ifdef SYNC_INPUT
pending_signals = 1; pending_signals = 1;
#endif
return -1; return -1;
} }
interrupt_input_pending = 0; interrupt_input_pending = 0;
#ifdef SYNC_INPUT
pending_signals = pending_atimers; pending_signals = pending_atimers;
#endif
BLOCK_INPUT; BLOCK_INPUT;
/* So people can tell when we have read the available input. */ /* So people can tell when we have read the available input. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment