diff options
author | lukechampine <luke.champine@gmail.com> | 2016-03-31 02:04:31 -0400 |
---|---|---|
committer | lukechampine <luke.champine@gmail.com> | 2016-03-31 02:04:31 -0400 |
commit | a18521271669148081771cbcf48194742d129e68 (patch) | |
tree | c0c02e2c8ac08b9d7835eed2c96c447306ddf822 | |
parent | update README with examples + benchmarks (diff) | |
download | stm-a18521271669148081771cbcf48194742d129e68.tar.gz stm-a18521271669148081771cbcf48194742d129e68.tar.xz |
only broadcast when at least one Var changed
-rw-r--r-- | stm.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -219,9 +219,11 @@ retry: globalLock.Unlock() goto retry } - // commit the write log - tx.commit() - globalCond.Broadcast() + // commit the write log and broadcast that variables have changed + if len(tx.writes) > 0 { + tx.commit() + globalCond.Broadcast() + } globalLock.Unlock() } |