From 4e017ef7a61c760e94d6bdeb6df5cb56a044adfc Mon Sep 17 00:00:00 2001 From: lukechampine Date: Wed, 30 Mar 2016 17:05:58 -0400 Subject: fix race condition in tx.Get --- stm.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stm.go') 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 } -- cgit v1.2.3