emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/process.c,v


From: Sam Steingold
Subject: [Emacs-diffs] Changes to emacs/src/process.c,v
Date: Sun, 25 Mar 2007 03:03:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Sam Steingold <sds>     07/03/25 03:03:40

Index: process.c
===================================================================
RCS file: /sources/emacs/emacs/src/process.c,v
retrieving revision 1.505
retrieving revision 1.506
diff -u -b -r1.505 -r1.506
--- process.c   20 Mar 2007 08:51:03 -0000      1.505
+++ process.c   25 Mar 2007 03:03:40 -0000      1.506
@@ -6501,17 +6501,17 @@
 #define WUNTRACED 0
 #endif /* no WUNTRACED */
       /* Keep trying to get a status until we get a definitive result.  */
-      while (1)
+      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 */
+          sleep (1);
          errno = 0;
          pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
-         if (! (pid < 0 && errno == EINTR))
-           break;
-         /* Avoid a busyloop: wait3 is a system call, so we do not want
-            to prevent the kernel from actually sending SIGCHLD to emacs
-            by asking for it all the time.  */
-         sleep (1);
        }
+      while (pid < 0 && errno == EINTR);
 
       if (pid <= 0)
        {




reply via email to

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