aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
authorMatt Joiner <anacrolix@gmail.com>2019-10-23 18:30:55 +1100
committerMatt Joiner <anacrolix@gmail.com>2019-10-23 18:30:55 +1100
commitc0ede237be948532a9113d6db072a7847d02c890 (patch)
tree509ad139815eca014f7d734d4e3135a6e676e1b2 /tx.go
parentRegister transaction condition with each read Var only (diff)
downloadstm-c0ede237be948532a9113d6db072a7847d02c890.tar.gz
stm-c0ede237be948532a9113d6db072a7847d02c890.tar.xz
Get rid of globalCond
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tx.go b/tx.go
index a17cc13..45f8006 100644
--- a/tx.go
+++ b/tx.go
@@ -39,7 +39,7 @@ func (tx *Tx) commit() {
// wait blocks until another transaction modifies any of the Vars read by tx.
func (tx *Tx) wait() {
- globalCond.L.Lock()
+ globalLock.Lock()
for v := range tx.reads {
v.watchers[tx] = struct{}{}
}
@@ -49,7 +49,7 @@ func (tx *Tx) wait() {
for v := range tx.reads {
delete(v.watchers, tx)
}
- globalCond.L.Unlock()
+ globalLock.Unlock()
}
// Get returns the value of v as of the start of the transaction.