From c35a2c748c6ad053344c9f15f6f86246e48628e0 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 2 Oct 2020 17:35:11 +1000 Subject: Only wake Tx if they're still reading a modified value --- tx.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tx.go') 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() } -- cgit v1.2.3