/* -----------------------------------------------------------------------------
- * $Id: Select.c,v 1.10 2000/03/20 09:42:50 andy Exp $
+ * $Id: Select.c,v 1.11 2000/03/23 12:02:38 simonmar Exp $
*
* (c) The GHC Team 1995-1999
*
int numFound;
nat min, delta;
int maxfd = -1;
+ rtsBool select_succeeded = rtsTrue;
struct timeval tv;
#ifndef linux_TARGET_OS
if (signals_pending()) {
RELEASE_LOCK(&sched_mutex);
start_signal_handlers();
+ /* Don't wake up any other threads that were waiting on I/O */
+ select_succeeded = rtsFalse;
break;
}
*/
if (run_queue_hd != END_TSO_QUEUE) {
RELEASE_LOCK(&sched_mutex);
+ select_succeeded = rtsFalse;
break;
}
next = tso->link;
switch (tso->why_blocked) {
case BlockedOnRead:
- ready = FD_ISSET(tso->block_info.fd, &rfd);
+ ready = select_succeeded && FD_ISSET(tso->block_info.fd, &rfd);
break;
case BlockedOnWrite:
- ready = FD_ISSET(tso->block_info.fd, &wfd);
+ ready = select_succeeded && FD_ISSET(tso->block_info.fd, &wfd);
break;
case BlockedOnDelay:
{
- int candidate; /* signed int is intentional */
#if defined(HAVE_SETITIMER)
if (tso->block_info.delay > delta) {
tso->block_info.delay -= delta;
ready = 1;
}
#else
+ int candidate; /* signed int is intentional */
candidate = tso->block_info.target - getourtimeofday();
if (candidate < 0) {
candidate = 0;