diff options
author | Matt Joiner <anacrolix@gmail.com> | 2019-11-04 15:52:42 +1100 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2019-11-04 15:52:42 +1100 |
commit | bbcb2aadd77d362849993806e5c3900b11a1502e (patch) | |
tree | 0c3969c1cb031acdf1a23975b850934d130da87d /funcs.go | |
parent | Use atomic pointers for Var data (diff) | |
download | stm-bbcb2aadd77d362849993806e5c3900b11a1502e.tar.gz stm-bbcb2aadd77d362849993806e5c3900b11a1502e.tar.xz |
Remove global lock
Diffstat (limited to 'funcs.go')
-rw-r--r-- | funcs.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 } |