aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-29 04:50:16 +0000
committerRichard M. Stallman1996-01-29 04:50:16 +0000
commitfb4c362712689ad37854943f8fd2ae9e954ced31 (patch)
tree7ee440eab0345757943002f1fda0e5fce8bf5c54 /src
parent8a9fe4d22b9108dbb75a08989f8c735ef73d4b37 (diff)
downloademacs-fb4c362712689ad37854943f8fd2ae9e954ced31.tar.gz
emacs-fb4c362712689ad37854943f8fd2ae9e954ced31.zip
(wait_reading_process_input): Call timer_check
and shorten the inner delay if appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/process.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index c68309432b5..2dd1a46c32d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -249,6 +249,8 @@ int proc_buffered_char[MAXDESC];
249 249
250static Lisp_Object get_process (); 250static Lisp_Object get_process ();
251 251
252extern EMACS_TIME timer_check ();
253
252/* Maximum number of bytes to send to a pty without an eof. */ 254/* Maximum number of bytes to send to a pty without an eof. */
253static int pty_max_bytes; 255static int pty_max_bytes;
254 256
@@ -2053,6 +2055,22 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2053 EMACS_SET_SECS_USECS (timeout, 100000, 0); 2055 EMACS_SET_SECS_USECS (timeout, 100000, 0);
2054 } 2056 }
2055 2057
2058 /* If our caller will not immediately handle keyboard events,
2059 run timer events directly.
2060 (Callers that will immediately read keyboard events
2061 call timer_delay on their own.) */
2062 if (read_kbd >= 0)
2063 {
2064 EMACS_TIME timer_delay = timer_check (1);
2065 if (! EMACS_TIME_NEG_P (timer_delay))
2066 {
2067 EMACS_TIME difference;
2068 EMACS_SUB_TIME (difference, timer_delay, timeout);
2069 if (EMACS_TIME_NEG_P (difference))
2070 timeout = timer_delay;
2071 }
2072 }
2073
2056 /* Cause C-g and alarm signals to take immediate action, 2074 /* Cause C-g and alarm signals to take immediate action,
2057 and cause input available signals to zero out timeout. 2075 and cause input available signals to zero out timeout.
2058 2076