[commit: ghc] master: Don't call dirty_MVAR on atomicReadMVar unless we change the MVar. (190d34a)

Edward Z. Yang ezyang at MIT.EDU
Thu Jul 11 02:07:48 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/190d34a68945120f5e283fc1c64ed6fe49710213

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

commit 190d34a68945120f5e283fc1c64ed6fe49710213
Author: Edward Z. Yang <ezyang at mit.edu>
Date:   Wed Jul 10 13:32:00 2013 -0700

    Don't call dirty_MVAR on atomicReadMVar unless we change the MVar.
    
    Signed-off-by: Edward Z. Yang <ezyang at mit.edu>

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

 rts/PrimOps.cmm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 4f7dffb..abe54c8 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -1527,15 +1527,15 @@ stg_atomicReadMVarzh ( P_ mvar, /* :: MVar a */ )
 
     LOCK_CLOSURE(mvar, info);
 
-    if (info == stg_MVAR_CLEAN_info) {
-        ccall dirty_MVAR(BaseReg "ptr", mvar "ptr");
-    }
-
     /* If the MVar is empty, put ourselves on the blocked readers
      * list and wait until we're woken up.
      */
     if (StgMVar_value(mvar) == stg_END_TSO_QUEUE_closure) {
 
+        if (info == stg_MVAR_CLEAN_info) {
+            ccall dirty_MVAR(BaseReg "ptr", mvar "ptr");
+        }
+
         ALLOC_PRIM_WITH_CUSTOM_FAILURE
             (SIZEOF_StgMVarTSOQueue,
              unlockClosure(mvar, stg_MVAR_DIRTY_info);





More information about the ghc-commits mailing list