Skip to content

Commit

Permalink
Fix bug that made all reads write their values on commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
fryguybob committed Feb 11, 2015
1 parent d50ea1f commit 6e1df4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rts/STM.c
Expand Up @@ -1106,7 +1106,12 @@ StgBool stmCommitTransaction(Capability *cap, StgTRecHeader *trec) {
FOR_EACH_ENTRY(trec, e, {
StgTVar *s;
s = e -> tvar;

#if defined(STM_CG_LOCK)
if (e -> new_value != e -> expected_value) {
#else
if ((!config_use_read_phase) || (e -> new_value != e -> expected_value)) {
#endif
// Either the entry is an update or we're not using a read phase:
// write the value back to the TVar, unlocking it if necessary.

Expand Down

0 comments on commit 6e1df4e

Please sign in to comment.