From bbcb2aadd77d362849993806e5c3900b11a1502e Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 4 Nov 2019 15:52:42 +1100 Subject: Remove global lock --- funcs.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'funcs.go') diff --git a/funcs.go b/funcs.go index bd2cf20..a311c9f 100644 --- a/funcs.go +++ b/funcs.go @@ -10,7 +10,7 @@ var ( reads: make(map[*Var]uint64), writes: make(map[*Var]interface{}), } - tx.cond.L = &globalLock + tx.cond.L = &tx.mu return tx }} ) @@ -44,14 +44,14 @@ retry: goto retry } // verify the read log - globalLock.Lock() + tx.lockAllVars() if !tx.verify() { - globalLock.Unlock() + tx.unlock() goto retry } // commit the write log and broadcast that variables have changed tx.commit() - globalLock.Unlock() + tx.unlock() tx.recycle() return ret } -- cgit v1.2.3