aboutsummaryrefslogtreecommitdiff
path: root/var.go
diff options
context:
space:
mode:
Diffstat (limited to 'var.go')
-rw-r--r--var.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/var.go b/var.go
new file mode 100644
index 0000000..3494352
--- /dev/null
+++ b/var.go
@@ -0,0 +1,15 @@
+package stm
+
+import "sync"
+
+// A Var holds an STM variable.
+type Var struct {
+ val interface{}
+ version uint64
+ mu sync.Mutex
+}
+
+// NewVar returns a new STM variable.
+func NewVar(val interface{}) *Var {
+ return &Var{val: val}
+}