comparison src/process.c @ 14890:71c2cf461805

(wait_reading_process_input_1): New (empty) function. (wait_reading_process_input): Call wait_reading_process_input_1. If timer_check runs some timers, retry it.
author Richard M. Stallman <rms@gnu.org>
date Wed, 27 Mar 1996 02:35:15 +0000
parents b0d0cd9b5905
children 3e0dc64a5cb8
comparison
equal deleted inserted replaced
14889:acc4f62dbeb0 14890:71c2cf461805
1957 This is also used in record_asynch_buffer_change. 1957 This is also used in record_asynch_buffer_change.
1958 For that purpose, this must be 0 1958 For that purpose, this must be 0
1959 when not inside wait_reading_process_input. */ 1959 when not inside wait_reading_process_input. */
1960 static int waiting_for_user_input_p; 1960 static int waiting_for_user_input_p;
1961 1961
1962 /* This is here so breakpoints can be put on it. */
1963 static
1964 wait_reading_process_input_1 ()
1965 {
1966 }
1967
1962 /* Read and dispose of subprocess output while waiting for timeout to 1968 /* Read and dispose of subprocess output while waiting for timeout to
1963 elapse and/or keyboard input to be available. 1969 elapse and/or keyboard input to be available.
1964 1970
1965 TIME_LIMIT is: 1971 TIME_LIMIT is:
1966 timeout in seconds, or 1972 timeout in seconds, or
2077 (Callers that will immediately read keyboard events 2083 (Callers that will immediately read keyboard events
2078 call timer_delay on their own.) */ 2084 call timer_delay on their own.) */
2079 if (1) 2085 if (1)
2080 { 2086 {
2081 EMACS_TIME timer_delay; 2087 EMACS_TIME timer_delay;
2082 int old_timers_run = timers_run; 2088 int old_timers_run;
2089
2090 retry:
2091 old_timers_run = timers_run;
2083 timer_delay = timer_check (1); 2092 timer_delay = timer_check (1);
2084 if (timers_run != old_timers_run && do_display) 2093 if (timers_run != old_timers_run && do_display)
2085 redisplay_preserve_echo_area (); 2094 {
2095 redisplay_preserve_echo_area ();
2096 /* We must retry, since a timer may have requeued itself
2097 and that could alter the time_delay. */
2098 goto retry;
2099 }
2100
2086 if (! EMACS_TIME_NEG_P (timer_delay) && time_limit != -1) 2101 if (! EMACS_TIME_NEG_P (timer_delay) && time_limit != -1)
2087 { 2102 {
2088 EMACS_TIME difference; 2103 EMACS_TIME difference;
2089 EMACS_SUB_TIME (difference, timer_delay, timeout); 2104 EMACS_SUB_TIME (difference, timer_delay, timeout);
2090 if (EMACS_TIME_NEG_P (difference)) 2105 if (EMACS_TIME_NEG_P (difference))
2091 { 2106 {
2092 timeout = timer_delay; 2107 timeout = timer_delay;
2093 timeout_reduced_for_timers = 1; 2108 timeout_reduced_for_timers = 1;
2094 } 2109 }
2110 }
2111 else
2112 {
2113 /* This is so a breakpoint can be put here. */
2114 wait_reading_process_input_1 ();
2095 } 2115 }
2096 } 2116 }
2097 2117
2098 /* Cause C-g and alarm signals to take immediate action, 2118 /* Cause C-g and alarm signals to take immediate action,
2099 and cause input available signals to zero out timeout. 2119 and cause input available signals to zero out timeout.