Commit 673b6f50 authored by Simon Marlow's avatar Simon Marlow

Revert "Disable the timer signal while blocked in select() (#5991)"

This reverts commit dd24d6bc.

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.
parent 096c29df
......@@ -221,19 +221,10 @@ awaitEvent(rtsBool wait)
ptv = NULL;
}
while (1) { // repeat the select on EINTR
// 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) {
/* Check for any interesting events */
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment