summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonm <unknown>1999-02-26 12:32:51 +0000
committersimonm <unknown>1999-02-26 12:32:51 +0000
commit1e2ed492e0feada0372ed6f510ac36ff42d241e4 (patch)
treec703aa2b955f4c6f8584f08dfb916ef5cd65ab2f
parent4d699d4161ca006ac83a8b79fbf94dfe64517039 (diff)
downloadhaskell-1e2ed492e0feada0372ed6f510ac36ff42d241e4.tar.gz
[project @ 1999-02-26 12:32:51 by simonm]
Fix run queue corruption bug.
-rw-r--r--ghc/rts/Schedule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c
index 0b273c403a..0f54706598 100644
--- a/ghc/rts/Schedule.c
+++ b/ghc/rts/Schedule.c
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.9 1999/02/05 16:02:53 simonm Exp $
+ * $Id: Schedule.c,v 1.10 1999/02/26 12:32:51 simonm Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -509,16 +509,17 @@ SchedulerStatus schedule(StgTSO *main, StgClosure **ret_val)
* t->link is already set to END_TSO_QUEUE.
*/
ASSERT(t->link == END_TSO_QUEUE);
- if (run_queue_tl != END_TSO_QUEUE) {
+ if (run_queue_tl == END_TSO_QUEUE) {
+ run_queue_hd = run_queue_tl = t;
+ } else {
ASSERT(get_itbl(run_queue_tl)->type == TSO);
if (run_queue_hd == run_queue_tl) {
run_queue_hd->link = t;
run_queue_tl = t;
} else {
run_queue_tl->link = t;
+ run_queue_tl = t;
}
- } else {
- run_queue_hd = run_queue_tl = t;
}
break;