From 0ee7214a53526ffe44caefd0bd78371179e67910 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 12 Oct 2005 14:10:12 +0000 Subject: [PATCH 1/1] [project @ 2005-10-12 14:10:12 by simonmar] - we should be acquiring the sm_lock around allocGroup() - sanity check threads as they are pulled off the blackhole_queue --- ghc/rts/Schedule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 49c28e6..cbbc21e 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1486,7 +1486,9 @@ scheduleHandleHeapOverflow( Capability *cap, StgTSO *t ) cap->r.rNursery->n_blocks == 1) { // paranoia to prevent infinite loop // if the nursery has only one block. + ACQUIRE_SM_LOCK bd = allocGroup( blocks ); + RELEASE_SM_LOCK cap->r.rNursery->n_blocks += blocks; // link the new group into the list @@ -3610,6 +3612,7 @@ checkBlackHoles( void ) ASSERT(t->why_blocked == BlockedOnBlackHole); type = get_itbl(t->block_info.closure)->type; if (type != BLACKHOLE && type != CAF_BLACKHOLE) { + IF_DEBUG(sanity,checkTSO(t)); t = unblockOneLocked(t); *prev = t; any_woke_up = rtsTrue; -- 1.7.10.4