[commit: ghc] master: rts: Clarify whitehole logic in threadPaused (1e47126)

git at git.haskell.org git at git.haskell.org
Tue Jun 27 17:34:58 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1e471265c1ea9b2c4e9709adc182c36d0635f071/ghc

>---------------------------------------------------------------

commit 1e471265c1ea9b2c4e9709adc182c36d0635f071
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Tue Jun 27 10:30:00 2017 -0400

    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


>---------------------------------------------------------------

1e471265c1ea9b2c4e9709adc182c36d0635f071
 rts/ThreadPaused.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c
index 4ebc632..2483466 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",



More information about the ghc-commits mailing list