[project @ 2005-10-12 14:10:12 by simonmar]
authorsimonmar <unknown>
Wed, 12 Oct 2005 14:10:12 +0000 (14:10 +0000)
committersimonmar <unknown>
Wed, 12 Oct 2005 14:10:12 +0000 (14:10 +0000)
- we should be acquiring the sm_lock around allocGroup()
- sanity check threads as they are pulled off the blackhole_queue

ghc/rts/Schedule.c

index 49c28e6..cbbc21e 100644 (file)
@@ -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;