Commit 95e6865e authored by Edward Z. Yang's avatar Edward Z. Yang

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's avatarEdward Z. Yang <ezyang@mit.edu>
parent 18087a11
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment