Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/392c2886dcd14e4aa57440b8169ba427f5a93c8b

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

commit 392c2886dcd14e4aa57440b8169ba427f5a93c8b
Author: Simon Marlow <marlo...@gmail.com>
Date:   Thu Apr 12 11:21:41 2012 +0100

    updateThunk: minor tweak to avoid an unnecessary call to checkBlockingQueues

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

 rts/Threads.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/rts/Threads.c b/rts/Threads.c
index 802a37c..997bcc8 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -424,12 +424,16 @@ updateThunk (Capability *cap, StgTSO *tso, StgClosure 
*thunk, StgClosure *val)
 
     updateWithIndirection(cap, thunk, val);
 
+    // sometimes the TSO is locked when we reach here, so its header
+    // might be WHITEHOLE.  Hence check for the correct owner using
+    // pointer equality first.
+    if ((StgTSO*)v == tso) {
+        return;
+    }
+
     i = v->header.info;
     if (i == &stg_TSO_info) {
-        owner = (StgTSO*)v;
-        if (owner != tso) {
-            checkBlockingQueues(cap, tso);
-        }
+        checkBlockingQueues(cap, tso);
         return;
     }
 



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to