comparison src/process.c @ 2894:646c5beae647

* process.c (wait_reading_process_input): Undo change of April 29th, since that re-introduces the race condition the comments are warning about. Call clear_waiting_for_input before calling status_notify, though.
author Jim Blandy <jimb@redhat.com>
date Wed, 19 May 1993 05:41:37 +0000
parents 4df57953d5d0
children 725698689fbd
comparison
equal deleted inserted replaced
2893:4df57953d5d0 2894:646c5beae647
1745 else 1745 else
1746 { 1746 {
1747 EMACS_SET_SECS_USECS (timeout, 100000, 0); 1747 EMACS_SET_SECS_USECS (timeout, 100000, 0);
1748 } 1748 }
1749 1749
1750 /* Cause C-g and alarm signals to take immediate action,
1751 and cause input available signals to zero out timeout.
1752
1753 It is important that we do this before checking for process
1754 activity. If we get a SIGCHLD after the explicit checks for
1755 process activity, timeout is the only way we will know. */
1756 if (XINT (read_kbd) < 0)
1757 set_waiting_for_input (&timeout);
1758
1750 /* If status of something has changed, and no input is 1759 /* If status of something has changed, and no input is
1751 available, notify the user of the change right away. After 1760 available, notify the user of the change right away. After
1752 this explicit check, we'll let the SIGCHLD handler zap 1761 this explicit check, we'll let the SIGCHLD handler zap
1753 timeout to get our attention. */ 1762 timeout to get our attention. */
1754 if (update_tick != process_tick && do_display) 1763 if (update_tick != process_tick && do_display)
1755 { 1764 {
1756 Atemp = input_wait_mask; 1765 Atemp = input_wait_mask;
1757 EMACS_SET_SECS_USECS (timeout, 0, 0); 1766 EMACS_SET_SECS_USECS (timeout, 0, 0);
1758 if (select (MAXDESC, &Atemp, 0, 0, &timeout) <= 0) 1767 if (select (MAXDESC, &Atemp, 0, 0, &timeout) <= 0)
1759 status_notify (); 1768 {
1769 /* It's okay for us to do this and then continue with
1770 the loop, since timeout has already been zeroed out. */
1771 clear_waiting_for_input ();
1772 status_notify ();
1773 }
1760 } 1774 }
1761
1762 /* Cause C-g and alarm signals to take immediate action,
1763 and cause input available signals to zero out timeout.
1764
1765 It is important that we do this before checking for process
1766 activity. If we get a SIGCHLD after the explicit checks for
1767 process activity, timeout is the only way we will know. */
1768 if (XINT (read_kbd) < 0)
1769 set_waiting_for_input (&timeout);
1770 1775
1771 /* Don't wait for output from a non-running process. */ 1776 /* Don't wait for output from a non-running process. */
1772 if (wait_proc != 0 && !NILP (wait_proc->raw_status_low)) 1777 if (wait_proc != 0 && !NILP (wait_proc->raw_status_low))
1773 update_status (wait_proc); 1778 update_status (wait_proc);
1774 if (wait_proc != 0 1779 if (wait_proc != 0