diff options
author | Matt Joiner <anacrolix@gmail.com> | 2020-08-28 09:08:03 +1000 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2020-08-28 09:08:03 +1000 |
commit | 148eb229195310021da7f5bc7b5e2ff9f766c7a0 (patch) | |
tree | 8d3ca0857fc39fb2be0ca0d1849107918d5ff40d | |
parent | Panic when a transaction blocks after reading nothing (diff) | |
download | stm-148eb229195310021da7f5bc7b5e2ff9f766c7a0.tar.gz stm-148eb229195310021da7f5bc7b5e2ff9f766c7a0.tar.xz |
Count wakes for unchanged var version
-rw-r--r-- | tx.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -43,9 +43,14 @@ func (tx *Tx) wait() { v.watchers.Store(tx, nil) } tx.mu.Lock() + firstWait := true for tx.verify() { + if !firstWait { + expvars.Add("wakes for unchanged versions", 1) + } expvars.Add("waits", 1) tx.cond.Wait() + firstWait=false } tx.mu.Unlock() for v := range tx.reads { |