summaryrefslogtreecommitdiff
path: root/rts/ThreadPaused.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-06-27 10:30:00 -0400
committerBen Gamari <ben@smart-cactus.org>2017-06-27 12:55:06 -0400
commit1e471265c1ea9b2c4e9709adc182c36d0635f071 (patch)
treee1563e27fd4d89cb147454b7f8e0903b5179ddd1 /rts/ThreadPaused.c
parent134652542923e432bffb9fafe87893d785a17aae (diff)
downloadhaskell-1e471265c1ea9b2c4e9709adc182c36d0635f071.tar.gz
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
Diffstat (limited to 'rts/ThreadPaused.c')
-rw-r--r--rts/ThreadPaused.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c
index 4ebc6328e2..2483466255 100644
--- a/rts/ThreadPaused.c
+++ b/rts/ThreadPaused.c
@@ -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",