aboutsummaryrefslogtreecommitdiff
path: root/funcs.go
diff options
context:
space:
mode:
Diffstat (limited to 'funcs.go')
-rw-r--r--funcs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/funcs.go b/funcs.go
index 3d89cc5..bd7f0e9 100644
--- a/funcs.go
+++ b/funcs.go
@@ -69,9 +69,9 @@ func AtomicGet(v *Var) interface{} {
// AtomicSet is a helper function that atomically writes a value.
func AtomicSet(v *Var, val interface{}) {
- Atomically(func(tx *Tx) {
- tx.Set(v, val)
- })
+ v.mu.Lock()
+ v.changeValue(val)
+ v.mu.Unlock()
}
// Compose is a helper function that composes multiple transactions into a