emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change in process.c


From: Chong Yidong
Subject: Re: Change in process.c
Date: Tue, 27 Mar 2007 17:16:05 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

Richard Stallman <address@hidden> writes:

> I don't mind making a change to fix this,
> but it must not do a full-second sleep before the first wait3,
> and it must not use usleep since that is obsolete.

Does this version work?

*** emacs/src/process.c.~1.508.~        2007-03-27 16:47:03.000000000 -0400
--- emacs/src/process.c 2007-03-27 17:13:31.000000000 -0400
***************
*** 6500,6516 ****
  #define WUNTRACED 0
  #endif /* no WUNTRACED */
        /* Keep trying to get a status until we get a definitive result.  */
!       do
          {
          /* For some reason, this sleep() prevents Emacs from sending
               loadavg to 5-8(!) for ~10 seconds.
               See http://thread.gmane.org/gmane.emacs.devel/67722 or
               http://www.google.com/search?q=busyloop+in+sigchld_handler */
!           usleep (1000);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
        }
-       while (pid < 0 && errno == EINTR);
  
        if (pid <= 0)
        {
--- 6500,6518 ----
  #define WUNTRACED 0
  #endif /* no WUNTRACED */
        /* Keep trying to get a status until we get a definitive result.  */
! 
!       errno = 0;
!       pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
!       while (pid < 0 && errno == EINTR)
          {
          /* For some reason, this sleep() prevents Emacs from sending
               loadavg to 5-8(!) for ~10 seconds.
               See http://thread.gmane.org/gmane.emacs.devel/67722 or
               http://www.google.com/search?q=busyloop+in+sigchld_handler */
!           sleep (1);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
        }
  
        if (pid <= 0)
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]