summaryrefslogtreecommitdiff
path: root/rts/sm/Evac.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2018-03-25 14:02:16 -0400
committerBen Gamari <ben@smart-cactus.org>2018-03-25 14:33:27 -0400
commitcf809950efb744ca884e0e0833a80ffd50527ca1 (patch)
treedc32069c86ec1212358797f5344102e9287ac0ef /rts/sm/Evac.c
parent9893042604cda5260cb0f7b674ed5c34b419e403 (diff)
downloadhaskell-cf809950efb744ca884e0e0833a80ffd50527ca1.tar.gz
Add Note [BLACKHOLE points to IND]
Test Plan: ci Reviewers: osa1, bgamari, erikd Reviewed By: osa1 Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4517
Diffstat (limited to 'rts/sm/Evac.c')
-rw-r--r--rts/sm/Evac.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c
index 27f280665e..06648c3de9 100644
--- a/rts/sm/Evac.c
+++ b/rts/sm/Evac.c
@@ -747,6 +747,19 @@ loop:
copy(p,info,q,sizeofW(StgInd),gen_no);
return;
}
+ // Note [BLACKHOLE pointing to IND]
+ //
+ // BLOCKING_QUEUE can be overwritten by IND (see
+ // wakeBlockingQueue()). However, when this happens we must
+ // be updating the BLACKHOLE, so the BLACKHOLE's indirectee
+ // should now point to the value.
+ //
+ // The mutator might observe an inconsistent state, because
+ // the writes are happening in another thread, so it's
+ // possible for the mutator to follow an indirectee and find
+ // an IND. But this should never happen in the GC, because
+ // the mutators are all stopped and the writes have
+ // completed.
ASSERT(i != &stg_IND_info);
}
q = r;