diff options
Diffstat (limited to 'rts/ThreadPaused.c')
-rw-r--r-- | rts/ThreadPaused.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index cccc7ad0b0..5cbb3f5595 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -334,6 +334,17 @@ threadPaused(Capability *cap, StgTSO *tso) } #endif + if (RTS_UNLIKELY(nonmoving_write_barrier_enabled + && ip_THUNK(INFO_PTR_TO_STRUCT(bh_info)))) { + // We are about to replace a thunk with a blackhole. + // Add the free variables of the closure we are about to + // overwrite to the update remembered set. + // N.B. We caught the WHITEHOLE case above. + updateRemembSetPushThunkEager(cap, + THUNK_INFO_PTR_TO_STRUCT(bh_info), + (StgThunk *) bh); + } + // The payload of the BLACKHOLE points to the TSO ((StgInd *)bh)->indirectee = (StgClosure *)tso; write_barrier(); |