[commit: ghc] master: Fix bug in readMVar implementation: keep clean MVars clean. (95e6865)
Edward Z. Yang
ezyang at ghc.haskell.org
Thu Jul 18 00:51:39 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/95e6865ecf06b2bd80fa737e4fa4a24beaae25c5
>---------------------------------------------------------------
commit 95e6865ecf06b2bd80fa737e4fa4a24beaae25c5
Author: Edward Z. Yang <ezyang at mit.edu>
Date: Wed Jul 17 15:49:47 2013 -0700
Fix bug in readMVar implementation: keep clean MVars clean.
The readMVar implementation had only partially implemented
a micro-optimization which allows us to avoid adding an MVar
to the mutable list if the MVar was not changed. However,
this was not applied to the release method on the fast path,
resulting in dirty MVars which were not added to the mutable list.
Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
>---------------------------------------------------------------
rts/PrimOps.cmm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 648594b..ced15ee 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -1563,7 +1563,7 @@ stg_readMVarzh ( P_ mvar, /* :: MVar a */ )
val = StgMVar_value(mvar);
- unlockClosure(mvar, stg_MVAR_DIRTY_info);
+ unlockClosure(mvar, info);
return (val);
}
@@ -1579,7 +1579,7 @@ stg_tryReadMVarzh ( P_ mvar, /* :: MVar a */ )
val = StgMVar_value(mvar);
- unlockClosure(mvar, stg_MVAR_DIRTY_info);
+ unlockClosure(mvar, info);
return (1, val);
}
More information about the ghc-commits
mailing list