Commit cf809950 authored by Simon Marlow's avatar Simon Marlow Committed by Ben Gamari
Browse files

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
parent 98930426
...@@ -203,6 +203,7 @@ loop: ...@@ -203,6 +203,7 @@ loop:
// just been replaced with an IND by another thread in // just been replaced with an IND by another thread in
// updateThunk(). In which case, if we read the indirectee // updateThunk(). In which case, if we read the indirectee
// again we should get the value. // again we should get the value.
// See Note [BLACKHOLE pointing to IND] in sm/Evac.c
goto loop; goto loop;
} }
......
...@@ -302,6 +302,7 @@ retry: ...@@ -302,6 +302,7 @@ retry:
// This could happen, if e.g. we got a BLOCKING_QUEUE that has // This could happen, if e.g. we got a BLOCKING_QUEUE that has
// just been replaced with an IND by another thread in // just been replaced with an IND by another thread in
// wakeBlockingQueue(). // wakeBlockingQueue().
// See Note [BLACKHOLE pointing to IND] in sm/Evac.c
goto retry; goto retry;
} }
......
...@@ -747,6 +747,19 @@ loop: ...@@ -747,6 +747,19 @@ loop:
copy(p,info,q,sizeofW(StgInd),gen_no); copy(p,info,q,sizeofW(StgInd),gen_no);
return; 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); ASSERT(i != &stg_IND_info);
} }
q = r; q = r;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment