diff options
Diffstat (limited to 'stm.go')
-rw-r--r-- | stm.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -231,7 +231,11 @@ func AtomicGet(v *Var) interface{} { func AtomicSet(v *Var, val interface{}) { // since we're only doing one operation, we don't need a full transaction globalLock.Lock() - (&Tx{writes: map[*Var]interface{}{v: val}}).commit() + v.mu.Lock() + v.val = val + v.version++ + v.mu.Unlock() + globalCond.Broadcast() globalLock.Unlock() } |