aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
authorMatt Joiner <anacrolix@gmail.com>2020-10-02 17:35:11 +1000
committerMatt Joiner <anacrolix@gmail.com>2020-10-02 17:35:11 +1000
commitc35a2c748c6ad053344c9f15f6f86246e48628e0 (patch)
treee33b8b691286fb48dd637d47589c4e163af62495 /tx.go
parentUse builtin eq var in rate and stmutil (diff)
downloadstm-c35a2c748c6ad053344c9f15f6f86246e48628e0.tar.gz
stm-c35a2c748c6ad053344c9f15f6f86246e48628e0.tar.xz
Only wake Tx if they're still reading a modified value
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/tx.go b/tx.go
index 3a1506c..c064f76 100644
--- a/tx.go
+++ b/tx.go
@@ -121,12 +121,14 @@ func (tx *Tx) Assert(p bool) {
}
func (tx *Tx) reset() {
+ tx.mu.Lock()
for k := range tx.reads {
delete(tx.reads, k)
}
for k := range tx.writes {
delete(tx.writes, k)
}
+ tx.mu.Unlock()
tx.removeRetryProfiles()
tx.resetLocks()
}