summaryrefslogtreecommitdiff
path: root/ghc/rts/Select.c
diff options
context:
space:
mode:
authorsimonmar <unknown>2004-09-03 15:28:59 +0000
committersimonmar <unknown>2004-09-03 15:28:59 +0000
commit95ca6bff6fc9918203173b442192d9298ef9757a (patch)
tree6aa809e688117710e8690201d6fb46b3aec0577d /ghc/rts/Select.c
parentaa07427aca52bcf2d76b8967aa27fe23fc8803bc (diff)
downloadhaskell-95ca6bff6fc9918203173b442192d9298ef9757a.tar.gz
[project @ 2004-09-03 15:28:18 by simonmar]
Cleanup: all (well, most) messages from the RTS now go through the functions in RtsUtils: barf(), debugBelch() and errorBelch(). The latter two were previously called belch() and prog_belch() respectively. See the comments for the right usage of these message functions. One reason for doing this is so that we can avoid spurious uses of stdout/stderr by Haskell apps on platforms where we shouldn't be using them (eg. non-console apps on Windows).
Diffstat (limited to 'ghc/rts/Select.c')
-rw-r--r--ghc/rts/Select.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ghc/rts/Select.c b/ghc/rts/Select.c
index 223bdd6551..a604bcdebb 100644
--- a/ghc/rts/Select.c
+++ b/ghc/rts/Select.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Select.c,v 1.32 2004/07/15 20:50:40 sof Exp $
+ * $Id: Select.c,v 1.33 2004/09/03 15:28:53 simonmar Exp $
*
* (c) The GHC Team 1995-2002
*
@@ -68,7 +68,7 @@ wakeUpSleepingThreads(nat ticks)
sleeping_queue = tso->link;
tso->why_blocked = NotBlocked;
tso->link = END_TSO_QUEUE;
- IF_DEBUG(scheduler,belch("Waking up sleeping thread %d\n", tso->id));
+ IF_DEBUG(scheduler,debugBelch("Waking up sleeping thread %d\n", tso->id));
PUSH_ON_RUN_QUEUE(tso);
flag = rtsTrue;
}
@@ -105,11 +105,11 @@ awaitEvent(rtsBool wait)
tv.tv_usec = 0;
IF_DEBUG(scheduler,
- belch("scheduler: checking for threads blocked on I/O");
+ debugBelch("scheduler: checking for threads blocked on I/O");
if (wait) {
- belch(" (waiting)");
+ debugBelch(" (waiting)");
}
- belch("\n");
+ debugBelch("\n");
);
/* loop until we've woken up some threads. This loop is needed
@@ -220,8 +220,6 @@ awaitEvent(rtsBool wait)
unblock_all = rtsTrue;
break;
} else {
- fprintf(stderr,"%d\n", errno);
- fflush(stderr);
perror("select");
barf("select failed");
}
@@ -299,7 +297,7 @@ awaitEvent(rtsBool wait)
}
if (ready) {
- IF_DEBUG(scheduler,belch("Waking up blocked thread %d\n", tso->id));
+ IF_DEBUG(scheduler,debugBelch("Waking up blocked thread %d\n", tso->id));
tso->why_blocked = NotBlocked;
tso->link = END_TSO_QUEUE;
PUSH_ON_RUN_QUEUE(tso);