aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stm.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/stm.go b/stm.go
index fcd1f02..8934455 100644
--- a/stm.go
+++ b/stm.go
@@ -135,6 +135,8 @@ func (tx *Tx) Get(v *Var) interface{} {
return val
}
// Otherwise, record and return its current value.
+ globalLock.Lock()
+ defer globalLock.Unlock()
tx.reads[v] = v.val
return v.val
}