aboutsummaryrefslogtreecommitdiff
path: root/stm.go
diff options
context:
space:
mode:
Diffstat (limited to 'stm.go')
-rw-r--r--stm.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/stm.go b/stm.go
index fc4a125..24e0e18 100644
--- a/stm.go
+++ b/stm.go
@@ -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()
}