Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • rts/ThreadPaused.c
    ... ... @@ -321,11 +321,12 @@ threadPaused(Capability *cap, StgTSO *tso)
    321 321
                 if(frame_info == &stg_bh_upd_frame_info) {
    
    322 322
                     // eager black hole: we do nothing
    
    323 323
     
    
    324
    -                // it should be a black hole that we own
    
    324
    +                // it should be a black hole (but we may not own it, as another
    
    325
    +                // thread could have raced us to claim it)
    
    325 326
                     ASSERT(bh_info == &stg_BLACKHOLE_info ||
    
    326 327
                            bh_info == &__stg_EAGER_BLACKHOLE_info ||
    
    327 328
                            bh_info == &stg_CAF_BLACKHOLE_info);
    
    328
    -                ASSERT(blackHoleOwner(bh) == tso || blackHoleOwner(bh) == NULL);
    
    329
    +
    
    329 330
                 } else {
    
    330 331
                     // lazy black hole
    
    331 332
     
    
    ... ... @@ -368,13 +369,15 @@ threadPaused(Capability *cap, StgTSO *tso)
    368 369
                     // The payload of the BLACKHOLE points to the TSO
    
    369 370
                     RELEASE_STORE(&((StgInd *)bh)->indirectee, (StgClosure *)tso);
    
    370 371
                     SET_INFO_RELEASE(bh,&stg_BLACKHOLE_info);
    
    372
    +            }
    
    371 373
     
    
    372
    -                // .. and we need a write barrier, since we just mutated the closure:
    
    373
    -                recordClosureMutated(cap,bh);
    
    374
    +            // We need a write barrier, since the closure was mutated (by
    
    375
    +            // threadPaused for lazy black holes, or the mutator for eager
    
    376
    +            // black holes).
    
    377
    +            recordClosureMutated(cap,bh);
    
    374 378
     
    
    375
    -                // We pretend that bh has just been created.
    
    376
    -                LDV_RECORD_CREATE(bh);
    
    377
    -            }
    
    379
    +            // We pretend that bh has just been created.
    
    380
    +            LDV_RECORD_CREATE(bh);
    
    378 381
     
    
    379 382
                 frame = (StgClosure *) ((StgUpdateFrame *)frame + 1);
    
    380 383
                 if (prev_was_update_frame) {