Commit 1e471265 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

rts: Clarify whitehole logic in threadPaused

Previously we would look at the indirectee field of a WHITEHOLE object.
However, WHITEHOLE isn't a sort of indirection and therefore has no
indirectee field.

I encountered this while investigating #13615, although it doesn't fix
that bug.

Test Plan: Validate

Reviewers: simonmar, austin, erikd

Subscribers: rwbarton, thomie

GHC Trac Issues: #13615

Differential Revision: https://phabricator.haskell.org/D3674
parent 13465254
......@@ -275,10 +275,9 @@ threadPaused(Capability *cap, StgTSO *tso)
// deadlocked on itself. See #5226 for an instance of
// this bug.
//
if ((bh_info == &stg_WHITEHOLE_info ||
bh_info == &stg_BLACKHOLE_info)
&&
((StgInd*)bh)->indirectee != (StgClosure*)tso)
if (((bh_info == &stg_BLACKHOLE_info)
&& ((StgInd*)bh)->indirectee != (StgClosure*)tso)
|| (bh_info == &stg_WHITEHOLE_info))
{
debugTrace(DEBUG_squeeze,
"suspending duplicate work: %ld words of stack",
......
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