[commit: ghc] master: Revert "Disable the timer signal while blocked in select() (#5991)" (673b6f5)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/673b6f50eca6f53cfb13b00e587c403c716baba1

>---------------------------------------------------------------

commit 673b6f50eca6f53cfb13b00e587c403c716baba1
Author: Simon Marlow <[email protected]>
Date:   Fri Sep 21 15:26:46 2012 +0100

    Revert "Disable the timer signal while blocked in select() (#5991)"
    
    This reverts commit dd24d6bc37879c6b32a3d5ac4ee765e59e13501c.
    
    This attempt to fix the problem was misguided: the program might be
    stuck in a foreign call rather than awaitEvent(), and then the timer
    signal will never get disabled.  The only way to turn off the timer
    signal in this case is in the timer interrupt handler itself.

>---------------------------------------------------------------

 rts/posix/Select.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/rts/posix/Select.c b/rts/posix/Select.c
index d638829..3d92a46 100644
--- a/rts/posix/Select.c
+++ b/rts/posix/Select.c
@@ -221,19 +221,10 @@ awaitEvent(rtsBool wait)
           ptv = NULL;
       }
 
-      while (1) { // repeat the select on EINTR
+      /* Check for any interesting events */
 
-          // Disable the timer signal while blocked in
-          // select(), to conserve power. (#1623, #5991)
-          if (wait) stopTimer();
-
-          numFound = select(maxfd+1, &rfd, &wfd, NULL, ptv);
-
-          if (wait) startTimer();
-
-          if (numFound >= 0) break;
-
-          if (errno != EINTR) {
+      while ((numFound = select(maxfd+1, &rfd, &wfd, NULL, ptv)) < 0) {
+	  if (errno != EINTR) {
 	    /* Handle bad file descriptors by unblocking all the
 	       waiting threads. Why? Because a thread might have been
 	       a bit naughty and closed a file descriptor while another
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.